check_procs ELAPSED

Edward J. Sabol sabol-2oVx0MVsMgiP/wAdlnoHchvRvTJiVFUC at public.gmane.org
Tue May 31 21:33:29 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. ]


-------------------------------------------------------
This SF.Net email is sponsored by Yahoo.
Introducing Yahoo! Search Developer Network - Create apps using Yahoo!
Search APIs Find out how you can build Yahoo! directly into your own
Applications - visit http://developer.yahoo.net/?fr=offad-ysdn-ostg-q22005
_______________________________________________________
Nagios Plugin Development Mailing List Nagiosplug-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f at public.gmane.org
Unsubscribe at https://lists.sourceforge.net/lists/listinfo/nagiosplug-devel
::: Please include plugins 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