summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 2eda58c)
raw | patch | inline | side by side (parent: 2eda58c)
author | Karl DeBisschop <kdebisschop@users.sourceforge.net> | |
Mon, 13 Jan 2003 12:09:49 +0000 (12:09 +0000) | ||
committer | Karl DeBisschop <kdebisschop@users.sourceforge.net> | |
Mon, 13 Jan 2003 12:09:49 +0000 (12:09 +0000) |
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@236 f882894a-f735-0410-b71e-b25c423dba1c
plugins/check_nagios.c | patch | blob | history |
diff --git a/plugins/check_nagios.c b/plugins/check_nagios.c
index ea79d24795941bab29f2eb138599d3fd7477e0a2..d19445a55b9389ff7f6603366a2e56269b846700 100644 (file)
--- a/plugins/check_nagios.c
+++ b/plugins/check_nagios.c
#include "popen.h"
#include "utils.h"
-#define PROGNAME "check_nagios"
+const char *PROGNAME = "check_nagios";
int process_arguments (int, char **);
void print_usage (void);
printf ("Could not open stderr for %s\n", PS_RAW_COMMAND);
}
- /* cound the number of matching Nagios processes... */
+ /* count the number of matching Nagios processes... */
while (fgets (input_buffer, MAX_INPUT_BUFFER - 1, child_process)) {
- if (strstr (input_buffer, process_string))
+ if (!strstr(input_buffer, argv[0]) && strstr(input_buffer, process_string))
proc_entries++;
}
switch (c) {
case '?': /* print short usage statement if args not parsable */
- printf ("%s: Unknown argument: %c\n\n", my_basename (argv[0]), optopt);
+ printf ("%s: Unknown argument: %c\n\n", PROGNAME, optopt);
print_usage ();
exit (STATE_UNKNOWN);
case 'h': /* help */
print_help ();
exit (STATE_OK);
case 'V': /* version */
- print_revision (my_basename (argv[0]), "$Revision$");
+ print_revision (PROGNAME, "$Revision$");
exit (STATE_OK);
case 'F': /* hostname */
status_log = optarg;
"-V, --version\n"
" Print version information\n\n"
"Example:\n"
- " ./check_nagios -H /usr/local/nagios/var/status.log -e 5 -C /usr/local/nagios/bin/nagios\n");
+ " ./check_nagios -F /usr/local/nagios/var/status.log -e 5 -C /usr/local/nagios/bin/nagios\n");
}