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

SourceForge.net noreply at sourceforge.net
Mon Aug 1 13:25:50 CEST 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

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
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-08-01 21:24

Message:
Logged In: YES 
user_id=664364

This has been changed in the upcoming 1.4.1 release so that ps axwo is 
tested first in configure.in, so I am placing this call into pending for 
confirmation of the fix, otherwise the call will automatically close after 14 
days.

Ton

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

Comment By: Tim (opensourceror55)
Date: 2005-05-10 02:19

Message:
Logged In: YES 
user_id=1275574

Correct me if I'm wrong but the options of the ps command
haven't actually changed - its just they've added a warning
because so many people were confused about the difference
between ps -axwo and ps axwo. By leaving it as ps -axwo
aren't you just causing more trouble as its the incorrect
options? The fact that they work for most people is just luck. 

Please change it to use the correct options by default and
leave a note in the REQUIREMENTS or wherever so that people
can edit configure.h if they need to use the broken way, not
the other way round.

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

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