[Pkg-nagios-devel] Bug#781016: monitoring-plugins: check_procs encounters problems with truncate ps-output

Andreas Unterkircher unki at netshadow.at
Mon Mar 23 09:33:25 UTC 2015


Package: monitoring-plugins
Version: 2.1.1-1proxybpo70+1
Severity: normal

Dear Maintainer,

I'm having a problem with check_procs on several Wheezy systems.
There is apache running on these systems and I'm checking for its procsses with check_procs.

First of all, the processes are actually there:

unki at wiki:/tmp$ ps ax | grep -i apache2
 2109 ?        Ss     0:13 /usr/sbin/apache2 -k start
 9029 ?        S      0:00 /usr/sbin/apache2 -k start
 9107 ?        Sl     0:12 /usr/sbin/apache2 -k start
 9108 ?        Sl     0:12 /usr/sbin/apache2 -k start
15884 pts/0    S+     0:00 grep -i apache2

unki at wiki:/tmp$ /usr/lib/nagios/plugins/check_procs --version
check_procs v2.1.1 (monitoring-plugins 2.1.1)

unki at wiki:/tmp$ /usr/lib/nagios/plugins/check_procs -vv -C apache2
CMD: /bin/ps axwwo 'stat uid pid ppid vsz rss pcpu etime comm args'
PROCS OK: 0 processes with command name 'apache2' | procs=0;;;0;

unki at wiki:/tmp$ /usr/lib/nagios/plugins/check_procs -vv -C apache
CMD: /bin/ps axwwo 'stat uid pid ppid vsz rss pcpu etime comm args'
PROCS OK: 0 processes with command name 'apache' | procs=0;;;0;

but with "apach" it's working (note the prog= in the output):

unki at wiki:/tmp$ /usr/lib/nagios/plugins/check_procs -vv -C apach
CMD: /bin/ps axwwo 'stat uid pid ppid vsz rss pcpu etime comm args'
Matched: uid=0 vsz=13516 rss=6276 pid=2109 ppid=1 pcpu=0.00 stat=Ss etime=3-19:18:10 prog=apach args=/usr/sbin/apache2 -k start
Matched: uid=33 vsz=12900 rss=3396 pid=9029 ppid=2109 pcpu=0.00 stat=S etime=1-03:57:50 prog=apach args=/usr/sbin/apache2 -k start
Matched: uid=33 vsz=237392 rss=8396 pid=9107 ppid=2109 pcpu=0.00 stat=Sl etime=1-03:57:49 prog=apach args=/usr/sbin/apache2 -k start
Matched: uid=33 vsz=236820 rss=7764 pid=9108 ppid=2109 pcpu=0.00 stat=Sl etime=1-03:57:49 prog=apach args=/usr/sbin/apache2 -k start
PROCS OK: 4 processes with command name 'apach' | procs=4;;;0;

also using an older version of check_procs on this machine shows the same behaviour:

unki at wiki:/tmp$ ./check_procs --version
check_procs v1.4.16 (nagios-plugins 1.4.16)

unki at wiki:/tmp$ ./check_procs -vv -C apache2
CMD: /bin/ps axwwo 'stat uid pid ppid vsz rss pcpu etime comm args'
PROCS OK: 0 processes with command name 'apache2' | procs=0;;;0;

unki at wiki:/tmp$ ./check_procs -vv -C apache
CMD: /bin/ps axwwo 'stat uid pid ppid vsz rss pcpu etime comm args'
PROCS OK: 0 processes with command name 'apache' | procs=0;;;0;

unki at wiki:/tmp$ ./check_procs -vv -C apach
CMD: /bin/ps axwwo 'stat uid pid ppid vsz rss pcpu etime comm args'
Matched: uid=0 vsz=13516 rss=6276 pid=2109 ppid=1 pcpu=0.00 stat=Ss etime=3-19:19:03 prog=apach args=/usr/sbin/apache2 -k start
Matched: uid=33 vsz=12900 rss=3396 pid=9029 ppid=2109 pcpu=0.00 stat=S etime=1-03:58:43 prog=apach args=/usr/sbin/apache2 -k start
Matched: uid=33 vsz=237392 rss=8396 pid=9107 ppid=2109 pcpu=0.00 stat=Sl etime=1-03:58:42 prog=apach args=/usr/sbin/apache2 -k start
Matched: uid=33 vsz=236820 rss=7764 pid=9108 ppid=2109 pcpu=0.00 stat=Sl etime=1-03:58:42 prog=apach args=/usr/sbin/apache2 -k start
PROCS OK: 4 processes with command name 'apach' | procs=4;;;0;

the output of the ps command:

unki at wiki:/tmp$ /bin/ps  --version
procps-ng version 3.3.3

unki at wiki:/tmp$ /bin/ps axwwo 'stat uid pid ppid vsz rss pcpu etime comm args'
STAT   UID   PID  PPID    VSZ   RSS %CPU     ELAPSED COMMAND         COMMAND
S        0     2     0      0     0  0.0  3-19:19:46 kthreadd        [kthreadd]
S        0     3     2      0     0  0.0  3-19:19:46 ksoftirqd/0     [ksoftirqd/0]
S        0     5     2      0     0  0.0  3-19:19:46 kworker/u:0     [kworker/u:0]
...
S       33  9029  2109  12900  3396  0.0  1-03:59:21 /usr/sbin/apach /usr/sbin/apache2 -k start
Sl      33  9107  2109 237392  8396  0.0  1-03:59:20 /usr/sbin/apach /usr/sbin/apache2 -k start
Sl      33  9108  2109 236820  7764  0.0  1-03:59:20 /usr/sbin/apach /usr/sbin/apache2 -k start
...

On a Squeeze machine it looks like this:

unki at proxy:~$ /usr/lib/nagios/plugins/check_procs -vv -C apache2
CMD: /bin/ps axwwo 'stat uid pid ppid vsz rss pcpu etime comm args'
Matched: uid=33 vsz=9192 rss=3612 pid=10239 ppid=31184 pcpu=0.00 stat=S etime=1-04:00:48 prog=apache2 args=/usr/sbin/apache2 -k start
Matched: uid=33 vsz=234972 rss=10116 pid=17847 ppid=31184 pcpu=0.30 stat=Sl etime=54:50 prog=apache2 args=/usr/sbin/apache2 -k start
Matched: uid=33 vsz=234648 rss=9608 pid=22279 ppid=31184 pcpu=0.30 stat=Sl etime=15:49 prog=apache2 args=/usr/sbin/apache2 -k start
Matched: uid=33 vsz=234524 rss=9704 pid=22375 ppid=31184 pcpu=0.30 stat=Sl etime=15:13 prog=apache2 args=/usr/sbin/apache2 -k start
Matched: uid=0 vsz=9668 rss=6028 pid=31184 ppid=1 pcpu=0.00 stat=Ss etime=5-22:07:39 prog=apache2 args=/usr/sbin/apache2 -k start
PROCS OK: 5 processes with command name 'apache2' | procs=5;;;0;


unki at proxy:~$ /bin/ps axwwo 'stat uid pid ppid vsz rss pcpu etime comm args'
STAT   UID   PID  PPID    VSZ   RSS %CPU     ELAPSED COMMAND         COMMAND
Ss       0     1     0   2064   592  0.0 26-02:59:54 init            init [2]
S        0     2     0      0     0  0.0 26-02:59:54 kthreadd        [kthreadd]
S        0     3     2      0     0  0.0 26-02:59:54 migration/0     [migration/0]
...
S       33 10239 31184   9192  3612  0.0  1-04:01:48 apache2         /usr/sbin/apache2 -k start
Sl      33 17847 31184 234964 10156  0.3       55:50 apache2         /usr/sbin/apache2 -k start
Sl      33 22279 31184 234664  9844  0.3       16:49 apache2         /usr/sbin/apache2 -k start
Sl      33 22375 31184 234524  9752  0.4       16:13 apache2         /usr/sbin/apache2 -k start
Ss       0 31184     1   9668  6028  0.0  5-22:08:39 apache2         /usr/sbin/apache2 -k start
...


I'm not sure whos problem this actually is - check_procs, ps or Apache?

-- System Information:
Debian Release: 7.8
  APT prefers stable
  APT policy: (990, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 3.2.0-4-amd64 (SMP w/3 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages monitoring-plugins depends on:
ii  monitoring-plugins-basic     2.1.1-1proxybpo70+1
ii  monitoring-plugins-standard  2.1.1-1proxybpo70+1

monitoring-plugins recommends no packages.

Versions of packages monitoring-plugins suggests:
pn  icinga | icinga | nagios3  <none>
pn  nagios-plugins-contrib     <none>

-- no debconf information



More information about the Pkg-nagios-devel mailing list