<div dir="ltr"><span style="font-family:arial,sans-serif;font-size:13px">Hello,</span><br><div dir="ltr" style="font-family:arial,sans-serif;font-size:13px"><div><br></div><div>I would like to monitor a daemon, by checking that there is exactly 1 "parent" running, to avoid the process to be run twice on the same box.</div>

<div>The daemon itself forks at certain times, so you can have a parent and multiple children.</div><div>I have other various ways of doing it, but as first solution I wanted to try using nagios.</div><br>My idea was to use the following command, by checking the "s" status flag from ps.<div>

<br>/usr/lib64/nagios/plugins/check_procs -C schedule_cron -sSs<div><br></div><div>This doesn't work, as check_procs doesn't seem to be checking the "s" flag.</div><div>With the -vv option to check_procs, I can see that the ps command used is:</div>

<div><br></div><div>CMD: /bin/ps -eo '<b>s</b> uid pid ppid vsz rss pcpu etime comm args'<br></div><div><br></div><div>Instead of the "s" column, "stat" would do the job I need.</div><div><br>
</div>
<div>I wonder if it would be possible to change the default format from s to stat, or to not alter an existing behaviour, provide an option -o or similar for users customisations.</div><div><br></div><div>I'm running nagios plugins 1.4.15, nagios 3.2.2, installed from rpm on a  redhat based distribution.</div>

<div><br></div><div>Regards,</div><div>Mauro</div></div></div></div>