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

SourceForge.net noreply at sourceforge.net
Tue Jul 24 15:50:03 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: 
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: Pending
Resolution: Works For Me
Priority: 5
Private: No
Submitted By: JamesMontrois (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

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

>Comment By: Matthias Eble (psychotrahe)
Date: 2007-07-24 15:50

Message:
Logged In: YES 
user_id=1694341
Originator: NO

Hi James,

I'm setting this item to pending meaning that it will get deleted if you
won't send a comment in the next 14 days.

Matthias

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

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

Message:
Logged In: YES 
user_id=1694341
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).


Matthias

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

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