[Nagiosplug-devel] Status flags supported by check_procs

Mauro galvao.m at gmail.com
Tue Mar 19 22:56:40 CET 2013


Hi Jochen,

I'ld assume that if you cannot get away from an aged OS distrib, you're
> unlikely to find a newer plugin version on a reputed repo, anyway, and
> command line control of the "ps" command is definitely absent from
> versions up to and including the current 1.4.16. If so, I don't see any
> way for you *other* than giving sources and (*if* necessary - see the
> 'stat' in my command above) explicit "./configure" options a try.
>
>
I tried to configure both 1.4.15 and 1.4.16, and on the same box where the
rpm is compiled I see the same ps command you see:

 /usr/local/src/nagios-plugins-1.4.16 > grep -A 1 -B 1 '[^A-Z_]PS_' config.h
/* Number of columns in ps command */
#define PS_COLS 9

/* Verbatim command to execute for ps in check_procs */
#define PS_COMMAND "/bin/ps axwo 'stat uid pid ppid vsz rss pcpu comm args'"

/* Format string for scanning ps output in check_procs */
#define PS_FORMAT "%s %d %d %d %d %d %f %s %n"

/* Whether the ps utility uses the "procetime" field */
/* #undef PS_USES_PROCETIME */

/* Variable list for sscanf of 'ps' output */
#define PS_VARLIST
procstat,&procuid,&procpid,&procppid,&procvsz,&procrss,&procpcpu,procprog,&pos


Problem is then the repo, but the OS seem fine to compile nagios-plugins on
my own. Even if I'm sure something won't be right with dependencies.



> Another word of warning, though: Have a look at the plugin's help text:
>
> >  -s, --state=STATUSFLAGS
> >    Only scan for processes that have, in the output of `ps`, one or
> >    more of the status flags you specify (for example R, Z, S, RS,
> >    RSZDT, plus others based on the output of your 'ps' command).
>
> The listed process state( char)s are *mutually exclusive*, and the
> interpretation of the --state option is that processes will be included
> into the selection if *ANY* of the chars appear in their s/stat column.
> In other words, you can select for 's'(ession leaders), but won't be
> able to make sure that it's not, e.g., 'Zs' or otherwise defunct within
> the same check.
>


I think -ss would be enough for me, as my final checker would be:

/usr/lib64/nagios/plugins/check_procs -c 1:1 -ss -C schedule_cron


>
> (Been there, done that, wrote my own check_nagios_procs explicitly
> telling the '^[RS]sl$' master process from its temporary children. :-} )
>
> Regards,
>                                                                 J. Bern
> --
> *NEU* - NEC IT-Infrastruktur-Produkte im <http://www.linworks-shop.de/>:
> Server--Storage--Virtualisierung--Management SW--Passion for Performance
> Jochen Bern, Systemingenieur --- LINworks GmbH <http://www.LINworks.de/>
> Postfach 100121, 64201 Darmstadt | Robert-Koch-Str. 9, 64331 Weiterstadt
> PGP (1024D/4096g) FP = D18B 41B1 16C0 11BA 7F8C DCF7 E1D5 FAF4 444E 1C27
> Tel. +49 6151 9067-231, Zentr. -0, Fax -299 - Amtsg. Darmstadt HRB 85202
> Unternehmenssitz Weiterstadt, Geschäftsführer Metin Dogan, Oliver Michel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.monitoring-plugins.org/archive/devel/attachments/20130319/eaf3c2d0/attachment.html>


More information about the Devel mailing list