check_procs -a limitation (#1328)

nameless-user notifications at github.com
Wed Mar 11 07:57:11 CET 2015


The following is being reported against
monitoring-plugins-v2.1.1-39-g8095, though it applies as well to earlier
releases.

There is a problem with the manner in which check_procs looks for
command-line arguments (the "-a" option):

    -a, --argument-array=STRING
        Only scan for processes with args that contain STRING.

The problem is that internally, check_procs depends on some variant of
"ps" to scan for processes.  And these days, many operating systems by
default limit the length of the command-line string returned by "ps"
to perhaps 80 characters or so.  In the configuration and compilation
of check_procs, an attempt is being made to overcome this limit, via
the configured definition of PS_COMMAND placed into the config.h file
by configure.  Here I show the value produced on my Linux machine:

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

The problem is, a single "w" option only widens the "ps" output a bit,
and not necessarily enough to encompass the target string a user is
looking for with the check_procs -a option.  (Processes can have very
long argument lists, and the distinguishing string you need to identify
a particular process of interest might not appear until close to the end.)

The Linux "man ps" output says this about the "w" option:

    w   Wide output. Use this option twice for unlimited width.

So my request here is that the derivation of the PS_COMMAND value,
at least on Linux platforms, be modified to use the "axwwo" options
instead of the "axwo" options.

Alas, my configure-fu is quite limited, and my git-fu is nonexistent,
so I can't propose exact code changes.

-- 
Reply to this email on GitHub:
https://github.com/monitoring-plugins/monitoring-plugins/issues/1328
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-plugins.org/archive/devel/attachments/20150310/3d498666/attachment.html>


More information about the Devel mailing list