Yes, Geneos can be configured to restart a process which has gone down, review the instructions below on how to achieve this.
Firstly you should setup a Processes sampler on the same machine which has the process you want to try and restart. Once run up you will see a view like below:
We are interested in the instance count column. We need to define a rule which detects the process dropping and running a script:
<rule name="Restart Process">
<targets>
<target>/geneos/gateway[(@name="systemAlerts")]/directory/probe[(@name="iwhddb2")]/managedEntity[(@name="Helpdesk DB")]/sampler[(@name="processes")][(@type="process")]/dataview[(@name="processes")]/rows/row[(@name="mysqld")]/cell[(@column="instanceCount")]</target>
</targets>
<priority>1</priority>
<pathAliases>
<pathAlias name="num">../../rows/row/cell[(@column="City")]</pathAlias>
</pathAliases>
<evaluateOnDataviewSample>false</evaluateOnDataviewSample>
<block>
<if>
<and>
<equal>
<dataItem>
<property>@value</property>
</dataItem>
<integer>0</integer>
</equal>
<lt>
<dataItem>
<property>state/@severity</property>
</dataItem>
<integer>2</integer>
</lt>
</and>
<transaction>
<delay unit="samples">2</delay>
<update>
<property>state/@severity</property>
<severity>warning</severity>
</update>
<action ref="Run Start Script"></action>
</transaction>
<if>
<and>
<equal>
<dataItem>
<property>state/@severity</property>
</dataItem>
<severity>warning</severity>
</equal>
<equal>
<dataItem>
<property>@value</property>
</dataItem>
<integer>0</integer>
</equal>
</and>
<transaction>
<delay unit="samples">2</delay>
<update>
<property>state/@severity</property>
<severity>critical</severity>
</update>
</transaction>
<transaction>
<update>
<property>state/@severity</property>
<severity>ok</severity>
</update>
</transaction>
</if>
</if>
</block>
</rule>
We have added the delay 2 samples to ensure the process is truly down, and a further escalation to critical in case the restart does not work.
The Action definition:
<action name="Run Start Script">
<script>
<exeFile>./startMyProcess.sh</exeFile>
<arguments>
<data></data>
</arguments>
<runLocation>netprobe</runLocation>
<probe ref="Netprobe"></probe>
</script>
</action>
There will need to be a script relative to the Netprobe which you invoke. The name and path of which should replace the ./startMyprocess.sh in the action definition above.
Comments
0 comments
Please sign in to leave a comment.