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

SourceForge.net noreply at sourceforge.net
Wed Jan 26 12:56:02 CET 2005


Bugs item #1106849, was opened at 2005-01-21 17:28
Message generated for change (Comment added) made by tonvoon
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: 7
Submitted By: Paulo Fessel (paulo_fessel)
>Assigned to: Ton Voon (tonvoon)
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.



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

>Comment By: Ton Voon (tonvoon)
Date: 2005-01-26 20:55

Message:
Logged In: YES 
user_id=664364

Paulo,

Thanks for the bug report.

This problem will have to stand. The configure script tries to 
work out the best ps command to use, but doesn't trap the stderr output. 
However, the plugin does, which is why you are getting this problem.

Long term, I think I will change the configure script so that it chooses the 
ps command based on the OS - this seems the best way to move 
forward, because ordering of the ps checks always seems to break for 
some OSes.

I am loathe to make any changes to configure.in of this scale for the 1.4 
release, so I have 
updated the REQUIREMENTS file to note the change you recommend to 
config.h.

Will work on this in the next major release.

Ton

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

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