[Nagiosplug-checkins] CVS: nagiosplug/plugins check_snmp.c,1.13,1.14

Subhendu Ghosh sghosh at users.sourceforge.net
Mon Nov 11 08:05:03 CET 2002


Update of /cvsroot/nagiosplug/nagiosplug/plugins
In directory usw-pr-cvs1:/tmp/cvs-serv6146

Modified Files:
	check_snmp.c 
Log Message:
option to specify a miblist - llow

Index: check_snmp.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_snmp.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -r1.13 -r1.14
*** check_snmp.c	11 Nov 2002 15:43:37 -0000	1.13
--- check_snmp.c	11 Nov 2002 16:04:12 -0000	1.14
***************
*** 35,39 ****
            [-C community] [-s string] [-r regex] [-R regexi] [-t timeout]\n\
            [-l label] [-u units] [-p port-number] [-d delimiter]\n\
!           [-D output-delimiter]"
  
  #define LONGOPTIONS "\
--- 35,39 ----
            [-C community] [-s string] [-r regex] [-R regexi] [-t timeout]\n\
            [-l label] [-u units] [-p port-number] [-d delimiter]\n\
!           [-D output-delimiter] [-m miblist]"
  
  #define LONGOPTIONS "\
***************
*** 71,77 ****
      Prefix label for output from plugin (default -s 'SNMP')\n\
   -v, --verbose\n\
!     Debugging the output\n\ 
! 		
! 		"
  
  #define NOTES "\
--- 71,77 ----
      Prefix label for output from plugin (default -s 'SNMP')\n\
   -v, --verbose\n\
!     Debugging the output\n\
!  -m, --miblist=STRING\n\
!     List of MIBS to be loaded (default = ALL)\n"
  
  #define NOTES "\
***************
*** 100,103 ****
--- 100,104 ----
  #define DEFAULT_PORT "161"
  #define DEFAULT_TIMEOUT 10
+ #define DEFAULT_MIBLIST "ALL"
  
  #include "common.h"
***************
*** 182,185 ****
--- 183,187 ----
  char *delimiter = NULL;
  char *output_delim = NULL;
+ char *miblist = NULL;
  
  
***************
*** 210,215 ****
  
  	/* create the command line to execute */
! 	asprintf (&command_line, "%s -m ALL -v 1 -c %s %s:%s %s",
! 	          PATH_TO_SNMPGET, community, server_address, port, oid);
  	if (verbose)
  		printf ("%s\n", command_line);
--- 212,217 ----
  
  	/* create the command line to execute */
! 	asprintf (&command_line, "%s -m %s -v 1 -c %s %s:%s %s",
! 	          PATH_TO_SNMPGET, miblist, community, server_address, port, oid);
  	if (verbose)
  		printf ("%s\n", command_line);
***************
*** 423,430 ****
  #ifdef HAVE_GETOPT_H
  		c =
! 			getopt_long (argc, argv, "hvVt:c:w:H:C:o:e:E:d:D:s:R:r:l:u:p:",
  									 long_options, &option_index);
  #else
! 		c = getopt (argc, argv, "hvVt:c:w:H:C:o:e:E:d:D:s:R:r:l:u:p:");
  #endif
  
--- 425,432 ----
  #ifdef HAVE_GETOPT_H
  		c =
! 			getopt_long (argc, argv, "hvVt:c:w:H:C:o:e:E:d:D:s:R:r:l:u:p:m:",
  									 long_options, &option_index);
  #else
! 		c = getopt (argc, argv, "hvVt:c:w:H:C:o:e:E:d:D:s:R:r:l:u:p:m:");
  #endif
  
***************
*** 603,606 ****
--- 605,611 ----
  			port = strscpy(port, optarg);
  			break;
+ 		case 'm':      /* List of MIBS  */
+ 			miblist = strscpy(miblist, optarg);
+ 			break;
  
  		}
***************
*** 645,648 ****
--- 650,656 ----
  	if (output_delim == NULL)
  		asprintf (&output_delim, DEFAULT_OUTPUT_DELIMITER);
+ 
+ 	if (miblist == NULL)
+ 		asprintf (&miblist, DEFAULT_MIBLIST);
  
  	if (label == NULL)





More information about the Commits mailing list