[Nagiosplug-devel] [ nagiosplug-Bugs-1106849 ] check_procs returns "WARNING" due to bad syntax of ps

SourceForge.net noreply at sourceforge.net
Fri Jan 21 09:29:58 CET 2005


Bugs item #1106849, was opened at 2005-01-21 15:28
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=1106849&group_id=29880

Category: Parsing problem
Group: snapshot tarball
Status: Open
Resolution: None
Priority: 5
Submitted By: Paulo Fessel (paulo_fessel)
Assigned to: Nobody/Anonymous (nobody)
Summary: check_procs returns "WARNING" due to bad syntax of ps

Initial Comment:
Everytime I use check_procs (from 1.4-beta1 on), I get 
warnings even when I haven't specified warning levels:

[root at nagios plugins]# ./check_procs
System call sent warnings to stderr
PROCS WARNING: 392 processes

Running with -vv, I see that there's a message from ps 
command which is interpreted incorrectly by the plugin:

[root at nagios plugins]# ./check_procs  -vv
CMD: /bin/ps -axwo 'stat uid ppid vsz rss pcpu comm 
args'
STDERR: Warning: bad syntax, perhaps a bogus '-'? See 
http://procps.sf.net/faq.html
System call sent warnings to stderr
PROCS WARNING: 345 processes

>From the FAQ of procps:

'Why does "ps -aux" complain about a bogus '-'?

'According to the POSIX and UNIX standards, the above 
command asks to display all processes with a TTY 
(generally the commands users are running) plus all 
processes owned by a user named "x". If that user 
doesn't exist, then ps will assume you really meant "ps 
aux". The warning is given to gently break you of a habit 
that will cause you trouble if a user named "x" were 
created.'

Thus the syntax of ps must be corrected. We should get 
rid of the "-" on "/bin/ps -axwo..." In fact, if I change 
PS_COMMAND manually on config.h the plugin works as 
expected:

[root at nagios plugins]# ./check_procs
PROCS OK: 470 processes

I'm getting this behaviour in Mandrake 10.0, with procps 
3.1.15 running on a dual-P4, 1 GB RAM.



----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=1106849&group_id=29880




More information about the Devel mailing list