I'm trying to set up a command to check for running processes using nagios. I create a check command named 'check_procs' with the command line:
$USER1$/check_procs -c $ARG1$ -C $ARG2$
Then i set up a service check named SpamAssassin with the arguments:
When there is an instance of the SpamAssassin program running, this check always fails. When i run it on the command line like so:
/usr/local/libexec/nagios/check_procs -c 1: -C spamd
I get the result: PROCS CRITICAL: 0 processes with command name 'spamd'
When i do a manual check using the following command line:
ps ax | grep spamd | grep -v "grep"
I get the correct result:
824 ?? Ss 0:27.91 /usr/local/bin/spamd -c -d -Q -x -r /var/run/spamd/spamd.pid (perl5.8.6)
38838 ?? S 0:04.79 spamd child (perl5.8.6)
66820 ?? S 0:00.01 spamd child (perl5.8.6)
Is this a bug in check_procs? Or am I executing it incorrectly.
Any help would be greatly appreciated!