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

SourceForge.net noreply at sourceforge.net
Mon Apr 3 14:44:15 CEST 2006


Bugs item #1463846, was opened at 2006-04-03 23:43
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=1463846&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: None
Group: None
Status: Open
Resolution: None
Priority: 5
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.


Lars

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

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




More information about the Devel mailing list