################################################################################
Command:
################################################################################

<command name="WIN-SERVICES_startService_command">
    <targets>
        <target>/geneos/gateway[(@name=&quot;MNL_PUGO_GATEWAY_123&quot;)]/directory/probe[(@name=&quot;GALORIO_PC_PROBE&quot;)]/managedEntity[(@name=&quot;WIN_MANAGED_ENTITY&quot;)]/sampler[(@name=&quot;win-services_sampler&quot;)][(@type=&quot;&quot;)]/dataview[(@name=&quot;win-services_sampler&quot;)]/rows/row[(@name=&quot;FrameServer&quot;)]/cell[(@column=&quot;status&quot;)]</target>
    </targets>
    <task>
        <commands>
            <commandRef>
                <internalCommand>
                    <name>/PLUGIN:WIN-SERVICES:startService</name>
                </internalCommand>
                <stopOnError>true</stopOnError>
            </commandRef>
        </commands>
        <args>
            <arg>
                <concatenate></concatenate>
                <static>START_SERVICE</static>
            </arg>
            <arg>
                <concatenate></concatenate>
                <xpath>@rowname</xpath>
            </arg>
        </args>
    </task>
</command>

################################################################################
Action:
################################################################################

<action name="startService_action">
    <command ref="WIN-SERVICES_startService_command">
        <args></args>
    </command>
</action>

################################################################################
Rule:
################################################################################

<rule name="service_status_rule">
    <targets>
        <target>/geneos/gateway[(@name=&quot;MNL_PUGO_GATEWAY_123&quot;)]/directory/probe[(@name=&quot;GALORIO_PC_PROBE&quot;)]/managedEntity[(@name=&quot;WIN_MANAGED_ENTITY&quot;)]/sampler[(@name=&quot;win-services_sampler&quot;)][(@type=&quot;&quot;)]/dataview[(@name=&quot;win-services_sampler&quot;)]/rows/row/cell[(@column=&quot;status&quot;)]</target>
    </targets>
    <priority>1</priority>
    <block>
        <if>
            <equal>
                <dataItem>
                    <property>@value</property>
                </dataItem>
                <string>Stopped</string>
            </equal>
            <transaction>
                <update>
                    <property>state/@severity</property>
                    <severity>critical</severity>
                </update>
                <action ref="startService_action"></action>
            </transaction>
            <transaction>
                <update>
                    <property>state/@severity</property>
                    <severity>ok</severity>
                </update>
            </transaction>
        </if>
    </block>
</rule>