Thanks @abrist for your investigation.
I really dont know, what is messy around my systems, because I installed from a image default by my provider. Think they using standard openSuSe repositories.
I'm playing around with the source code of "check_proc". So I first 'mark' the error printf to be sure, I found the correct place where the error is thrown.
Then I let printf the PS_COMMAND, that means: "ps -laxnwww"
Try this on the prompt:
Code: Select all
# ps -laxnwww | head -5
warning: bad ps syntax, perhaps a bogus '-'?
See http://gitorious.org/procps/procps/blobs/master/Documentation/FAQ
F UID PID PPID PRI NI VSZ RSS WCHAN STAT TTY TIME COMMAND
1 0 2 0 20 0 0 0 5f3f5 S ? 0:37 [kthreadd]
1 0 3 2 20 0 0 0 45be5 S ? 65:09 [ksoftirqd/0]
1 0 6 2 -100 - 0 0 ae0cd S ? 1:52 [migration/0]
1 0 7 2 -100 - 0 0 c546a S ? 0:44 [watchdog/0]
#
Huh, that IS the "error", but I think this is NOT an error. "ps laxnwww" give the same output, except the warning.
OK, so I take a deeper look to the source, found PS_VARLIST and PS_FORMAT.
On my 12.2 System the #defines look like:
Code: Select all
#define PS_COMMAND "/usr/bin/ps -laxnwww"
#define PS_VARLIST &procuid,&procpid,&procppid,&procvsz,&procrss,procstat,&pos,procprog
#define PS_FORMAT "%*s %d %d %d %*s %*s %*s %d %d %*s %s %*s %*s %n%s"
@12.3
Code: Select all
#define PS_COMMAND "/usr/bin/ps axwo 'stat uid pid ppid vsz rss pcpu comm args'"
#define PS_VARLIST procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos
#define PS_FORMAT "%s %d %d %d %d %d %f %s %n"
First, the format description on 12.2 differs from the available variables (15 format descriptors and 8 variables?) like in source fo the 12.3 system.
Now I execute the "/usr/bin/ps axwo 'stat uid pid ppid vsz rss pcpu comm args'" on 12.2 (remeber, alternate syntax) and get the result:
Code: Select all
# /usr/bin/ps axwo stat,uid,pid,ppid,vsz,rss,pcpu,comm,args | head -5
STAT UID PID PPID VSZ RSS %CPU COMMAND COMMAND
S 0 2 0 0 0 0.0 kthreadd [kthreadd]
S 0 3 2 0 0 0.0 ksoftirqd/0 [ksoftirqd/0]
S 0 6 2 0 0 0.0 migration/0 [migration/0]
S 0 7 2 0 0 0.0 watchdog/0 [watchdog/0]
#
Yippie!!!
In a transcendent multidimensional godlike inspiration

I replaced the #defines for PS_COMMAND, PS_VARLIST, PS_FORMAT with the values from the generated 12.3 code in config.h.
The PS_COMMAND I change to the alternativ syntax from
Code: Select all
#define PS_COMMAND "/usr/bin/ps axwo 'stat uid pid ppid vsz rss pcpu comm args'"
to
Code: Select all
#define PS_COMMAND "/usr/bin/ps axwo stat,uid,pid,ppid,vsz,rss,pcpu,comm,args"
Then "make all" and !surprise

surprise!:
Code: Select all
12.2 # ./plugins/check_procs -w 5 -c 10 --metric=CPU
CPU CRITICAL: 1 crit, 0 warn out of 141 processes | procs=141;;;0; procs_warn=0;;;0; procs_crit=1;;;0;
12.2 #
Doing the same on the 11.4 system, except to change the path to ps from /usr/bin/ps to /bin/ps, because there is no linked file "/usr/bin/ps -> /bin/ps". Same result of check_proc:
Code: Select all
11.4 # ./plugins/check_procs -w 5 -c 10 --metric=CPU
CPU OK: 151 processes | procs=151;;;0; procs_warn=0;;;0; procs_crit=0;;;0;
11.4 #
In my view, this is the correct output for check_procs, or I'm wrong? Can you please confirm the output?
I don't know why my ps is different from other systems, I swear I do nothing with the base installation! Sometimes I think linux is a shortcut for "Let It Not Useful Xtra"....
Thanks for all your help.
Lutz