[Nagiosplug-checkins] CVS: nagiosplug/plugins check_nagios.c,1.2,1.3
Karl DeBisschop
kdebisschop at users.sourceforge.net
Mon Jan 13 04:10:05 CET 2003
Update of /cvsroot/nagiosplug/nagiosplug/plugins
In directory sc8-pr-cvs1:/tmp/cvs-serv16050
Modified Files:
check_nagios.c
Log Message:
check for a few null strings, change PROGNAME from #define to const *char
Index: check_nagios.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_nagios.c,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** check_nagios.c 19 Jun 2002 05:11:52 -0000 1.2
--- check_nagios.c 13 Jan 2003 12:09:49 -0000 1.3
***************
*** 31,35 ****
#include "utils.h"
! #define PROGNAME "check_nagios"
int process_arguments (int, char **);
--- 31,35 ----
#include "utils.h"
! const char *PROGNAME = "check_nagios";
int process_arguments (int, char **);
***************
*** 94,100 ****
}
! /* cound the number of matching Nagios processes... */
while (fgets (input_buffer, MAX_INPUT_BUFFER - 1, child_process)) {
! if (strstr (input_buffer, process_string))
proc_entries++;
}
--- 94,100 ----
}
! /* count the number of matching Nagios processes... */
while (fgets (input_buffer, MAX_INPUT_BUFFER - 1, child_process)) {
! if (!strstr(input_buffer, argv[0]) && strstr(input_buffer, process_string))
proc_entries++;
}
***************
*** 184,188 ****
switch (c) {
case '?': /* print short usage statement if args not parsable */
! printf ("%s: Unknown argument: %c\n\n", my_basename (argv[0]), optopt);
print_usage ();
exit (STATE_UNKNOWN);
--- 184,188 ----
switch (c) {
case '?': /* print short usage statement if args not parsable */
! printf ("%s: Unknown argument: %c\n\n", PROGNAME, optopt);
print_usage ();
exit (STATE_UNKNOWN);
***************
*** 191,195 ****
exit (STATE_OK);
case 'V': /* version */
! print_revision (my_basename (argv[0]), "$Revision$");
exit (STATE_OK);
case 'F': /* hostname */
--- 191,195 ----
exit (STATE_OK);
case 'V': /* version */
! print_revision (PROGNAME, "$Revision$");
exit (STATE_OK);
case 'F': /* hostname */
***************
*** 264,267 ****
" 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");
}
--- 264,267 ----
" Print version information\n\n"
"Example:\n"
! " ./check_nagios -F /usr/local/nagios/var/status.log -e 5 -C /usr/local/nagios/bin/nagios\n");
}
More information about the Commits
mailing list