[Nagiosplug-devel] check_procs problem

Subhendu Ghosh sghosh at sghosh.org
Wed Jan 8 08:20:06 CET 2003


On Wed, 8 Jan 2003, James Fidell wrote:

> Quoting Subhendu Ghosh (sghosh at sghosh.org):
> 
> > Does the following work on FreeBSD? (one liner from configure.in)
> > 
> > ps waxco 'state command vsz rss uid user ppid' 2>/dev/null | egrep -i 
> > "^STAT +COMMAND +VSZ +RSS +UID +USER +PPID"
> 
> Did you mean egrep -v ?  If so, it only gives the command name, rather
> than all the arguments, too (this is on FreeBSD 4.6).

no - wanted "egrep -i" to see the header for the ps output.

If the above succeeds, the follwoing are set:
PS_RAW_COMMAND,"$PATH_TO_PS waxo 'state uid ppid command'"
PS_COMMAND,"$PATH_TO_PS waxco 'state uid ppid command command'"
PS_FORMAT,"%s %d %d %s %n"


Perhaps as Ton Voon stated - the second command needs to be changed to 
PS_COMMAND,"$PATH_TO_PS waxo 'state uid ppid command'"

command without -c will list both executable and args, but with -c only 
lists the command.

-sg

> 
> It looks like the problem might be the "c" option to ps.  Removing it
> gives me the entire command line.  Of course that's not really what we
> want either, because it makes it non-trivial to match the -C parameter
> to check_procs.
> 
> It looks like it may be necessary to run ps more than once to handle
> the "check_procs -C cmd -a args"; once to match "cmd" and then again
> once per process to match "args".  Perhaps this already happens.
> Unfortunately the machine I have nagios installed on is having a fit
> at the moment.  It's also 60 miles away and it's snowing, so I won't
> be going there to fix it today.  I'll look into this a bit further once
> I can get access to the machine again.
> 
> James
> 

-- 









More information about the Devel mailing list