[Nagiosplug-devel] [ nagiosplug-Bugs-1928399 ] check_procs METRIC_CPU should ignore kernel procs on FreeBSD

SourceForge.net noreply at sourceforge.net
Tue May 27 23:56:01 CEST 2008


Bugs item #1928399, was opened at 2008-03-29 02:29
Message generated for change (Settings changed) made by tonvoon
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=1928399&group_id=29880

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: General plugin execution
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Steve Wills (stevewills)
Assigned to: Nobody/Anonymous (nobody)
>Summary: check_procs METRIC_CPU should ignore kernel procs on FreeBSD

Initial Comment:
I'm using check_procs to check for processes which stopped living and become crazy mixed up zombies which eat all the CPU. This works fine on Linux, but on FreeBSD, the check_procs module detects the idle thread(s) as using 100% CPU. Of course the idle thread(s) aren't the ones I want to alarm about.

On FreeBSD I can detect kernel threads by finding the processes whose parent process ID is 0 (except PID 1 which is always init). I've attached a patch which makes check_procs skip kernel threads.

I'm not sure if this patch is appropriate for other platforms, but it might be a start. A better approach might be to provide an option to ignore kernel threads (I tried to look at how to do this on Linux and gave up, and I have no idea bout other platforms) and/or an option that is the opposite of the -p flag (ignore processes of particular ppid).

But for now, the attached patch makes check_procs CPU metric much more useful on FreeBSD, although an #ifdef FREEBSD or something similar might be warranted.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=1928399&group_id=29880




More information about the Devel mailing list