diff options
author | Karl DeBisschop <kdebisschop@users.sourceforge.net> | 2003-01-13 12:09:49 +0000 |
---|---|---|
committer | Karl DeBisschop <kdebisschop@users.sourceforge.net> | 2003-01-13 12:09:49 +0000 |
commit | be20f98d02ad60637e0092de3d4b48407fa1543f (patch) | |
tree | 729332c16b4e137ff91c66d29565e2709ec4947b /plugins | |
parent | 2eda58cc9130eebf2fb8117d6e7468686992e196 (diff) | |
download | monitoring-plugins-be20f98d02ad60637e0092de3d4b48407fa1543f.tar.gz |
check for a few null strings, change PROGNAME from #define to const *char
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@236 f882894a-f735-0410-b71e-b25c423dba1c
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/check_nagios.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/plugins/check_nagios.c b/plugins/check_nagios.c index ea79d247..d19445a5 100644 --- a/plugins/check_nagios.c +++ b/plugins/check_nagios.c @@ -30,7 +30,7 @@ #include "popen.h" #include "utils.h" -#define PROGNAME "check_nagios" +const char *PROGNAME = "check_nagios"; int process_arguments (int, char **); void print_usage (void); @@ -93,9 +93,9 @@ main (int argc, char **argv) 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++; } @@ -183,14 +183,14 @@ process_arguments (int argc, char **argv) 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; @@ -263,5 +263,5 @@ print_help (void) "-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"); } |