[Nagiosplug-devel] check_procs problem

Dave Viner dviner at yahoo-inc.com
Wed Jan 8 09:08:12 CET 2003


how about these args for ps on freebsd:

/bin/ps waxo 'state uid ppid ucomm command'

the ucomm column according to the man page should print 
	"ucomm      name to be used for accounting"
which on my system is the command name without any path.
but command will still print out the full executable and arguments.

dave

-----Original Message-----
From: nagiosplug-devel-admin at lists.sourceforge.net
[mailto:nagiosplug-devel-admin at lists.sourceforge.net]On Behalf Of
Subhendu Ghosh
Sent: Wednesday, January 08, 2003 8:20 AM
To: nagiosplug-devel at lists.sourceforge.net
Subject: Re: [Nagiosplug-devel] check_procs problem


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
> 

-- 







-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
Nagiosplug-devel mailing list
Nagiosplug-devel at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagiosplug-devel






More information about the Devel mailing list