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

Michael Bakker michael at securityfocus.de
Fri Dec 17 05:37:03 CET 2004


On Fri, Dec 17, 2004 at 01:14:10PM -0000, Voon, Ton wrote:
> I'm getting a contradiction here. You say:
> 
> $ /usr/local/nagios/libexec/check_procs -v -v -v
> /bin/ps -weo 'stat uid ppid comm args'
> OK - 10 processes running
> 
> But then later your config.h from 1.4-alpha3 shows:
> #define PS_COMMAND "/bin/ps -weo 'stat uid ppid vsz rss pcpu etime comm
> args'"
> 
> Are you sure you have compiled check_procs with the 1.4-alpha3 release?
> 
> Can you also provide a head -5 of the following:
> 
> ps -axwo 'stat comm vsz rss user uid ppid args' 
> ps -weo 'stat comm vsz rss user uid ppid etime args' 
> ps waxco 'state command vsz rss uid user ppid' 
> 
> May need to reorder the ps checks in configure.in. Also, what is your uname
> -m, uname -s, uname -r and uname -v output?
> 
> Ton
> 

<cut> 

Hey,

okay I mixed up some things, I'm sorry. Everything I'm pasting now is
based on nagios-plugins-1.4.0-alpha3 source:

$ grep -i ps 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) */

$ ./check_procs -v -v -v
CMD: /bin/ps -weo 'stat uid ppid vsz rss pcpu etime comm args'
ILs+     0 33671  2064 1584  0.0     05:20:22 bash                -bash (bash)
seconds: 19222
0 0 2064 1584 33671 0.00 ILs+ 05:20:22 bash -bash (bash)
SLs      0 35015  2060 1568  0.0        01:01 bash                -bash (bash)
seconds: 61
1 0 2060 1568 35015 0.00 SLs 01:01 bash -bash (bash)
SL+      0 35017  2548 1092  0.0        00:00 check_procs ./check_procs -v -v -v
seconds: 0
2 0 2548 1092 35017 0.00 SL+ 00:00 check_procs ./check_procs -v -v -v
RL+      0 35336  1388  816  0.0        00:00 ps /bin/ps -weo stat uid ppid vsz rss pcpu etime comm args
seconds: 0
2 0 1388 816 35336 0.00 RL+ 00:00 ps /bin/ps -weo stat uid ppid vsz rss
pcpu etime comm args
ILs+     0     1  1276  676  0.0 146-23:10:13 getty /usr/libexec/getty Pc ttyv0
seconds: 12697813
3 0 1276 676 1 0.00 ILs+ 146-23:10:13 getty /usr/libexec/getty Pc ttyv0
ILs+     0     1  1276  676  0.0 146-23:10:53 getty /usr/libexec/getty Pc ttyv1
seconds: 12697853
4 0 1276 676 1 0.00 ILs+ 146-23:10:53 getty /usr/libexec/getty Pc ttyv1
ILs+     0     1  1276  676  0.0 146-23:10:53 getty /usr/libexec/getty Pc ttyv2
seconds: 12697853
5 0 1276 676 1 0.00 ILs+ 146-23:10:53 getty /usr/libexec/getty Pc ttyv2
ILs+     0     1  1276  676  0.0 146-23:10:53 getty /usr/libexec/getty Pc ttyv3
seconds: 12697853
6 0 1276 676 1 0.00 ILs+ 146-23:10:53 getty /usr/libexec/getty Pc ttyv3
ILs+     0     1  1276  676  0.0 146-23:10:53 getty /usr/libexec/getty Pc ttyv4
seconds: 12697853
7 0 1276 676 1 0.00 ILs+ 146-23:10:53 getty /usr/libexec/getty Pc ttyv4
ILs+     0     1  1276  676  0.0 146-23:10:53 getty /usr/libexec/getty Pc ttyv5
seconds: 12697853
8 0 1276 676 1 0.00 ILs+ 146-23:10:53 getty /usr/libexec/getty Pc ttyv5
ILs+     0     1  1276  676  0.0 146-23:10:53 getty /usr/libexec/getty Pc ttyv6
seconds: 12697853
9 0 1276 676 1 0.00 ILs+ 146-23:10:53 getty /usr/libexec/getty Pc ttyv6
ILs+     0     1  1276  676  0.0 146-23:10:53 getty /usr/libexec/getty Pc ttyv7
seconds: 12697853
10 0 1276 676 1 0.00 ILs+ 146-23:10:53 getty /usr/libexec/getty Pc ttyv7
PROCS OK: 11 processes

$ ps -axwo 'stat comm vsz rss user uid ppid args' | head -5
STAT COMMAND               VSZ  RSS USER     UID  PPID COMMAND
DLs  swapper                 0    4 root       0     0  (swapper)
ILs  init                  760  176 root       0     0 /sbin/init --
DL   g_event                 0   12 root       0     0  (g_event)
DL   g_up                    0   12 root       0     0  (g_up)
$ ps -weo 'stat comm vsz rss user uid ppid etime args' | head -5
STAT COMMAND               VSZ  RSS USER   UID  PPID      ELAPSED
COMMAND
ILs+ bash                 2064 1584 root     0 33671     05:22:50 -bash (bash)
SLs  bash                 2060 1568 root     0 35015        03:29 -bash (bash)
RL+  ps                   1384  816 root     0 35017        00:00 ps -weo stat comm vsz rss user uid ppid etime args
RL+  bash                 2060 1568 root     0 35017        00:00 head -5 (bash)
$ ps waxco 'state command vsz rss uid user ppid' | head -5
STAT COMMAND            VSZ  RSS   UID USER    PPID
DLs  swapper              0    4     0 root       0
ILs  init               760  176     0 root       0
DL   g_event              0   12     0 root       0
DL   g_up                 0   12     0 root       0

$ uname -m
i386
$ uname -s
FreeBSD
$ uname -r
5.2.1-RELEASE
$ uname -v
FreeBSD 5.2.1-RELEASE #0: Mon Feb 23 20:45:55 GMT 2004 root at wv1u.btc.adaptec.com:/usr/obj/usr/src/sys/GENERIC

I still didnt have any time to diff the sources - maybe I can sent you
the nagios-plugins sources of the FreeBSD package system?

-- 
Greets,
Michael Bakker




More information about the Help mailing list