Found it! RE: Getting this error

frank ratty at they.org
Wed Feb 9 02:59:36 CET 2005


I came across this just today myself. I'm confused as to why I never hit 
it before because the bug is in the plugins 1.4-beta1 also and I've been 
using it for a couple weeks.

The problem is how check_procs calls the 'ps' command.

After running ./configure on the plugins you'll find a config.h file that 
defines a ton of things, including:

#define PS_COMMAND "/bin/ps -axwo 'stat uid ppid vsz rss pcpu comm args'"


The args to 'ps' are clearly BSD based, but they're being called in the 
SysV style.


>From the 'ps' man-page:
<quote>
COMMAND-LINE OPTIONS
This version of ps accepts several kinds of options:
1   UNIX options, which may be grouped and must be preceeded by a dash.
2   BSD options, which may be grouped and must not be used with a dash.
3   GNU long options, which are preceeded by two dashes.

Options of different types may be freely mixed, but conflicts can appear. 
There are some synonomous options, which are functionally identical, due 
to the many standards and ps implementations that this ps is compatible 
with.

Note that "ps -aux" is distinct from "ps aux". The POSIX and UNIX 
standards require that "ps -aux" print all processes owned by a user named 
"x", as well as printing all processes that would be selected by the -a 
option. If the user named "x" does not exist, this ps may interpret the 
command as "ps aux" instead and print a warning. This behavior is intended 
to aid in transitioning old scripts and habits. It is fragile, subject to 
change, and thus should not be relied upon.
</quote>

This can be fixed by hand between the ./configure and make commands by 
editing the config.h but really its up to the package owner to fix it in 
configure.in and re-release.


-frank


P.S. It can be helpful to run your strace commands with a '-sX' option 
(where X is a reasonable integer) so your read() and write() calls display 
more of the data being read and written. The default is 32 characters.


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list