[Nagiosplug-help] Problem with check_procs on FreeBSD 5.2.1 & 5.3

Michael Bakker michael at securityfocus.de
Fri Dec 17 00:31:06 CET 2004


On Thu, Dec 16, 2004 at 02:51:53PM -0000, Voon, Ton wrote:

$ /usr/local/nagios/libexec/check_procs -v -v -v
/bin/ps -weo 'stat uid ppid comm args'
OK - 10 processes running

$ grep -i ps ~/nagios-plugins-1.4.0-alpha3/config.h
/* Define to 1 if you have the `pstat_getdynamic' function. */
/* #undef HAVE_PSTAT_GETDYNAMIC */
/* Number of columns in ps command */
#define PS_COLS 9
/* Verbatim command to execute for ps in check_procs */
#define PS_COMMAND "/bin/ps -weo 'stat uid ppid vsz rss pcpu etime comm args'"
/* Format string for scanning ps output in check_procs */
#define PS_FORMAT "%s %d %d %d %d %f %s %s %n"
/* Variable list for sscanf of 'ps' output */
#define PS_VARLIST
procstat,&procuid,&procppid,&procvsz,&procrss,&procpcpu,procetime,procprog,&pos
   (4.3BSD, SunOS 4, HP-UX, AIX PS/2) */

When I type 'ps -weo 'stat uid ppid comm args'' I really see only 10
procs:
 
$ ps -weo 'stat uid ppid comm args'
STAT   UID  PPID COMMAND             COMMAND
SLs      0 33671 bash                -bash (bash)
RL+      0 33673 ps                  ps -weo stat uid ppid comm args
ILs+     0     1 getty               /usr/libexec/getty Pc ttyv0
ILs+     0     1 getty               /usr/libexec/getty Pc ttyv1
ILs+     0     1 getty               /usr/libexec/getty Pc ttyv2
ILs+     0     1 getty               /usr/libexec/getty Pc ttyv3
ILs+     0     1 getty               /usr/libexec/getty Pc ttyv4
ILs+     0     1 getty               /usr/libexec/getty Pc ttyv5
ILs+     0     1 getty               /usr/libexec/getty Pc ttyv6
ILs+     0     1 getty               /usr/libexec/getty Pc ttyv7

I've just looked into the portage/package system of this 2 FreeBSD
systems and there is a port for "nagios-plugins" v1.3.1
(net-mgmt/nagios-plugins). This version of check_procs works fine on
FreeBSD 5.2.1 and 5.3! I will make some diff between this version and
your public version if you are interested in fixing this issue. I'll
have to leave now but here some little information for now:

$ ./work/nagios-plugins-1.3.1/plugins/check_procs -v -v -v
/bin/ps -axwo 'stat uid ppid ucomm command'
OK - 95 processes running


> Michael,
> 
> What is the output from check_procs -v -v -v ?
> 
> Also, what is the ps command in config.h? If this ps command is not the best
> one to run for FreeBSD, can you suggest an alternative?
> 
> Ton
> 
> -----Original Message-----
> From: Michael Bakker [mailto:michael at securityfocus.de] 
> Sent: 16 December 2004 14:27
> To: nagiosplug-help at lists.sourceforge.net
> Subject: [Nagiosplug-help] Problem with check_procs on FreeBSD 5.2.1 & 5.3
> 
> 
> Hi,
> 
> I've got a problem with the check_procs plugin on systems with FreeBSD 5.2.1
> and 5.3:
> 
> $ /usr/local/nagios/libexec/check_procs
> OK - 10 processes running
> 
> There are much more processes running than 10 running - the other problem
> is:
> 
> $ ps auxw | grep [c]ron
> root     419  0.0  0.3  1344  776  ??  Ss   23Jul04   1:38.28 /usr/sbin/cron
> $ /usr/local/nagios/libexec/check_procs -w 1: -C cron
> WARNING - 0 processes running with command name cron
> 
> check_procs from nagios-plugins v1.3.1 and 1.4.0-alpha3 return the same
> results for me.

-- 
Greets,
Michael Bakker




More information about the Help mailing list