[Nagiosplug-devel] [ nagiosplug-Bugs-1118832 ] check_procs reports incorrect number of processes

SourceForge.net noreply at sourceforge.net
Tue May 24 17:48:45 CEST 2005


Bugs item #1118832, was opened at 2005-02-08 14:00
Message generated for change (Comment added) made by seanius
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=397597&aid=1118832&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: Argument proccessing
Group: snapshot tarball
>Status: Closed
>Resolution: Fixed
Priority: 5
Submitted By: Chris (clambertus)
>Assigned to: M. Sean Finney (seanius)
Summary: check_procs reports incorrect number of processes

Initial Comment:
When check_procs is used with a system like check_nrpe,
the nrpe daemon executes popen(), which causes
check_procs to be executed as "sh -c
/path/to/check_procs argument_list" 

This causes erroneous returns because check_procs fails
the strcmp(procprog,progname) call, since the
"procprog" is actually sh. 

To fix this, I added an additional strstr() call which
compares progname against procargs and discards the
line if "check_procs" appears in the process argument list.

This is not an ideal solution, but should take care of
the vast majority of cases where check_procs is used
with check_nrpe or similar utilities.


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

>Comment By: M. Sean Finney (seanius)
Date: 2005-05-24 20:46

Message:
Logged In: YES 
user_id=226838

this issue should be solved now.  instead of  looking at the
process names as strings, i've modified check_procs to also
be able to get the pid of all the processes, which it can
compare against the output of getpid(). 

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

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




More information about the Devel mailing list