<ruleGroup name="Counting Alerts">
    <rule name="Count Warnings">
        <targets>
            <target>/geneos/gateway/directory/probe/managedEntity/sampler/dataview/headlines/cell[(@name=&quot;Warnings&quot;)]</target>
        </targets>
        <priority>1</priority>
        <pathAliases>
            <pathAlias name="numWarnings">../../rows/row/cell[(state(&quot;severity&quot;)=&quot;2&quot;)][(@column=&quot;freeInodes&quot;)]</pathAlias>
        </pathAliases>
        <block>
            <set>
                <var ref="numOfWarnings"></var>
                <count>
                    <dataItems>
                        <pathAlias ref="numWarnings"></pathAlias>
                        <property>@value</property>
                    </dataItems>
                </count>
            </set>
            <transaction>
                <update>
                    <property>@value</property>
                    <var ref="numOfWarnings"></var>
                </update>
            </transaction>
        </block>
    </rule>
    <rule name="Count Criticals">
        <targets>
            <target>/geneos/gateway/directory/probe/managedEntity/sampler/dataview/headlines/cell[(@name=&quot;Criticals&quot;)]</target>
        </targets>
        <priority>1</priority>
        <pathAliases>
            <pathAlias name="numcriticals">../../rows/row/cell[(state(&quot;severity&quot;)=&quot;3&quot;)][(@column=&quot;freeInodes&quot;)]</pathAlias>
        </pathAliases>
        <block>
            <set>
                <var ref="numOfcriticals"></var>
                <count>
                    <dataItems>
                        <pathAlias ref="numcriticals"></pathAlias>
                        <property>@value</property>
                    </dataItems>
                </count>
            </set>
            <transaction>
                <update>
                    <property>@value</property>
                    <var ref="numOfcriticals"></var>
                </update>
            </transaction>
        </block>
    </rule>
    <rule name="Summary">
        <targets>
            <target>/geneos/gateway/directory/probe/managedEntity/sampler/dataview/headlines/cell[(@name=&quot;AlertSummary&quot;)]</target>
        </targets>
        <priority>1</priority>
        <pathAliases>
            <pathAlias name="warnings">../cell[(@name=&quot;Warnings&quot;)]</pathAlias>
            <pathAlias name="criticals">../cell[(@name=&quot;Criticals&quot;)]</pathAlias>
        </pathAliases>
        <block>
            <set>
                <var ref="numWarnings"></var>
                <dataItem>
                    <pathAlias ref="warnings"></pathAlias>
                    <property>@value</property>
                </dataItem>
            </set>
            <set>
                <var ref="numCriticals"></var>
                <dataItem>
                    <pathAlias ref="criticals"></pathAlias>
                    <property>@value</property>
                </dataItem>
            </set>
            <if>
                <gt>
                    <var ref="numCriticals"></var>
                    <integer>0</integer>
                </gt>
                <transaction>
                    <update>
                        <property>@value</property>
                        <var ref="numCriticals"></var>
                    </update>
                    <update>
                        <property>state/@severity</property>
                        <severity>critical</severity>
                    </update>
                </transaction>
                <if>
                    <gt>
                        <var ref="numWarnings"></var>
                        <integer>0</integer>
                    </gt>
                    <transaction>
                        <update>
                            <property>@value</property>
                            <var ref="numWarnings"></var>
                        </update>
                        <update>
                            <property>state/@severity</property>
                            <severity>warning</severity>
                        </update>
                    </transaction>
                    <transaction>
                        <update>
                            <property>@value</property>
                            <integer>0</integer>
                        </update>
                        <update>
                            <property>state/@severity</property>
                            <severity>ok</severity>
                        </update>
                    </transaction>
                </if>
            </if>
        </block>
    </rule>
</ruleGroup>