[Nagiosplug-devel] [ nagiosplug-Bugs-1463846 ] check_procs via nrpe - proc count

SourceForge.net noreply at sourceforge.net
Sun Jul 15 16:23:53 CEST 2007

Bugs item #1463846, was opened at 2006-04-03 23:43
Message generated for change (Comment added) made by psychotrahe
You can respond by visiting: 

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: None
Group: None
Status: Open
>Resolution: Works For Me
Priority: 5
Private: No
Submitted By: NotDisplayed123 (lbruun)
Assigned to: Nobody/Anonymous (nobody)
Summary: check_procs via nrpe - proc count

Initial Comment:
nrpe uses the popen to execute the check command. This 
means that a new shell will be spawned.

check_procs should take care to ignore this process. 
If not then if check_procs is used with the -a option 
it will count one too many processes it its count.

At the moment when nrpe executes check_procs I see two 
processes on my system:

../libexec/check_procs ..... foo
sh -c ../libexec/check_procs ...... foo

If my check_procs -a argument is "foo" then both of 
the above will be matched. Only the first will be 
caught by the ignore self catch.

If I go back to an old version of check_procs that 
uses the old method to ignore self (compare procname 
against string constant "check_procs") and the old 
method to extract the basename (a strtok() loop) then 
I have no problem.

I'm not saying those fixes should be undone. It's just 
an observation. I must admit I cannot really see how 
this has worked in the past... but it did.

One obvious fix to the problem would be to test not 
only against mypid but also against myppid.

I'm on Solaris but I doubt there's any difference 
between Solaris and Linux in this respect.



>Comment By: Matthias Eble (psychotrahe)
Date: 2007-07-15 16:23

Logged In: YES 
Originator: NO

Hi Lars,

is this still an issue? I tried this with the latest cvs and the problem
doesn't seem to occur. Yet I could imagine also ignoring processes where
ppid is check_procs' pid (to ignore the ps command called by check_procs).



You can respond by visiting: 

More information about the Devel mailing list