nagios nrpe check_procs wrong return value

Solution 1:

I think it's a bug in check_procs: it seems to pick up itself when running from nrpe, as opposed to the command line. Maybe a race condition of some sort.

I see you're running Ubuntu, given your command prompt. With the check_procs available on Lucid, I'm able to do something like:

/usr/lib/nagios/plugins/check_procs --ereg-argument-array="[s]tring" -w 1:1

So, we'll do a pattern match on the argument list, but in such a way that the check_procs process won't be matched. Putting one character of the pattern into square brackets causes the expression to match on "string" but it obviously won't match on the check_procs argument "[s]tring".

The check_procs available on Hardy doesn't have the regex option, though.

Solution 2:

There is problem with a /bin/ps output on host. By default, "check_procs" binary do a "/bin/ps -axwo" on checked system, which cut arg string. Just recompile nagios-plugins from source. On version 1.4.15 must set configure options:

./configure --enable-extra-opts=yes --with-ps-command="/bin/ps -axwwo 'stat uid pid ppid vsz rss pcpu ucomm command'" --with-ps-format="%s %d %d %d %d %d %f %s %n" --with-ps-cols=9 --with-ps-varlist="procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos"

When we set -axWWo - ps get us full string of arguments. Sorry for my ingreesh.