[Nagiosplug-devel] New plugin contrib : check_procl - %CPU/%MEM/CPUTIME checks

Jerome Tytgat jtytgat at websurg.com
Thu Jul 4 00:54:06 CEST 2002


I've written a plugin for nagios in shell unix, I know it's dirty, maybe
sometimes slow, especially on some
commands (checking the %all% keyword, returning a sum of all process) but,
i've developped this
for the enterprise for which I'm working and it do a great job.

Ok if this can go to the contrib directory, it's GPL of course.

It has several functionnality :
    - can return the percentage of CPU used by a process
    - can return the percentage of Memory used by a process
    - can return the CPU time used by a process
    - can accumulate several process (ie : CPUTIME used by SMTP + DNS)
    - Have a MAX special feature : return the process which eat the max of
    - Have a ALL special feature : return the sum of all process
    - Have the possibility to exclude some process (usefull to ignore things
like kapmd-idle for example)

Bug known :
    - The Warning and Critical values are not checked enough to be really
    - I've seen something weird with the --mem switch, sometimes it can go
      that 100 %, can someone check the ps command and see if I'm wrong ?
    - The MAX feature does not calculate the cumumlative max of a process ,
      return the cumulative of the process :

        ex :        % MEM        command
                        20.7             SMTP
                          5.1             HTTPD
                          5.9             HTTPD
                        15.9             HTTPD

        The function return SMTP as the process which eat the more %MEM but
it's HTTPD in real who eat the MAX...
    - The program can be very slow (shell loop problem) with the ALL keyword
    - Several problems with solaris...
            - The cputime format is not fixed size on solaris and may vary,
I do
              not handle DAY for the moment.
            - The type command return error code 1 if we use SH (??!??), had
to use BASH, so yes you need BASH
            - The let command does not exist under SH, had to use BASH, so
yes you need BASH
            - The ps command format is really different from linux one, so I
had to tweak it a lot...

Dependencies :
    The program is based on these tools :
        - bash (let / test / type)
        - cut
        - egrep
        - expr
        - grep
        - ps
        - sed
        - sort
        - tail
        - tr
        - wc

Greets goes to Websurg, for allowing me to program this during my work time
(Of course it's for them, I've developped it...),
and goes to Manu Feig and Jacques Kern, my beta testers and friends :)

BTW : hail to the developpers of NAGIOS and NAGIOS plugins, GREAT job guys !

Jérôme Tytgat
Network security Engineer
@ Websurg.com
mailto:j.tytgat at sioban.net / mailto:jtytgat at websurg.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: check_procl.sh
Type: application/octet-stream
Size: 12390 bytes
Desc: not available
URL: <https://www.monitoring-plugins.org/archive/devel/attachments/20020704/81aea188/attachment.obj>

More information about the Devel mailing list