[Nagiosplug-devel] [ nagiosplug-Bugs-837535 ] check_procs - still counts itself with -a

SourceForge.net noreply at sourceforge.net
Thu Nov 6 14:05:36 CET 2003


Bugs item #837535, was opened at 2003-11-06 15:04
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=837535&group_id=29880

Category: Parsing problem
Group: CVS
Status: Open
Resolution: None
Priority: 5
Submitted By: Ben Whaley (bwhaley)
Assigned to: Nobody/Anonymous (nobody)
Summary: check_procs - still counts itself with -a

Initial Comment:
This is a continuation of the bug 
[ 820125 ] check_procs arg-array check matches itself @ sol8

The CVS fix for this problem was:

/* Ignore self */
if (strcmp (procprog, progname) == 0) {
continue;
}

However, this is comparing progname to procprog. procprog will be 
whatever the program was called as (i.e. /tmp/nagios-plugins-1.3.
1/plugins/check_proc, /usr/local/nagios/libexec/check_proc, 
whatever) while progname will _always_ be simply check_proc. To fix 
this, I did the following:


/* Changed this to "char *progname = "" *; */
const char *progname = "check_procs";
const char *revision = "$Revision: 1.22 $";
const char *copyright = "2000-2003";
const char *email = "nagiosplug-devel at lists.sourceforge.net";
....

in main():

int result = STATE_UNKNOWN;

/* Added this */
progname = argv[0];

setlocale (LC_ALL, "");
....


Also, is there something going on with the version numbers? With 
the 1.3.1 release of nagios-plugins, check_procs --version says 1.
9.2.1. The CVS version, however, is 1.22. 


Thanks,
Ben


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

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




More information about the Devel mailing list