[Nagiosplug-devel] Re: check_procs ELAPSED

Edward J. Sabol sabol at alderaan.gsfc.nasa.gov
Tue May 31 12:35:43 CEST 2005


> I installed Nagios on Solaris and Linux.

Note that the ELAPSED metric is only supposed to work on Linux.

> I´m trying to use check_procs plugin to check java process etime (ps –eo 
> etime), so I want to receive an alert if the java process has an elapsed 
> time higher than 1000 second
>
> The command is:
> /usr/lib/nagios/plugins/check_procs -C java –c 1000 --metric=ELAPSED
>
> -m, --metric=TYPE
>    Check thresholds against metric. Valid types:
>    PROCS   - number of processes (default)
>    VSZ     - virtual memory size
>    RSS     - resident set memory size
>    CPU     - percentage cpu
>    ELAPSED - time elapsed in seconds
>
> but the result isn´t correct.
>
> Am I using the correct syntax ?.

Yes, I think you are. I recently needed to implement a service check using
check_proc's ELAPSED metric, and I couldn't get it to work either. After
looking the code, I believe there is a problem with the source code.

Which version of Linux are you using? On my Red Hat Linux 7.3 system,
check_procs executes:
   /bin/ps -axwo 'stat uid ppid vsz rss pcpu comm args'

However, the process etime needed for the ELAPSED metric test is not included
in the output of that command! In order to get the etime, the command needs
to be the followng instead:

/bin/ps axwwo 'stat uid ppid vsz rss pcpu etime comm args'

If you change the PS_COMMAND in config.h, however, the parsing of the `ps'
output may need to be altered in check_procs. I still need to check on that,
and it's not clear to me what the impact is on check_nagios which also uses
PS_COMMAND.

Later,
Ed

[ Please forgive the cross-posting, but I felt I strayed far enough into the
  development side that it warranted posting to the nagiosplug-devel mailing
  list. ]




More information about the Devel mailing list