[Nagiosplug-devel] Status flags supported by check_procs

Mauro galvao.m at gmail.com
Tue Mar 19 12:20:45 CET 2013


Hello,

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.
The daemon itself forks at certain times, so you can have a parent and
multiple children.
I have other various ways of doing it, but as first solution I wanted to
try using nagios.

My idea was to use the following command, by checking the "s" status flag
from ps.

/usr/lib64/nagios/plugins/check_procs -C schedule_cron -sSs

This doesn't work, as check_procs doesn't seem to be checking the "s" flag.
With the -vv option to check_procs, I can see that the ps command used is:

CMD: /bin/ps -eo '*s* uid pid ppid vsz rss pcpu etime comm args'

Instead of the "s" column, "stat" would do the job I need.

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.

I'm running nagios plugins 1.4.15, nagios 3.2.2, installed from rpm on a
 redhat based distribution.

Regards,
Mauro
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-plugins.org/archive/devel/attachments/20130319/45bcef94/attachment.html>


More information about the Devel mailing list