[Nagiosplug-checkins] CVS: nagiosplug/plugins check_snmp.c,1.27,1.28

Karl DeBisschop kdebisschop at users.sourceforge.net
Sat Aug 2 09:43:03 CEST 2003


Update of /cvsroot/nagiosplug/nagiosplug/plugins
In directory sc8-pr-cvs1:/tmp/cvs-serv12108

Modified Files:
	check_snmp.c 
Log Message:
markup for translation

Index: check_snmp.c
===================================================================
RCS file: /cvsroot/nagiosplug/nagiosplug/plugins/check_snmp.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -C2 -r1.27 -r1.28
*** check_snmp.c	9 May 2003 03:00:34 -0000	1.27
--- check_snmp.c	2 Aug 2003 16:42:48 -0000	1.28
***************
*** 25,79 ****
  
  const char *progname = "check_snmp";
! #define REVISION "$Revision$"
! #define COPYRIGHT "1999-2002"
! #define AUTHOR "Ethan Galstad"
! #define EMAIL "nagios at nagios.org"
! #define SUMMARY "Check status of remote machines using SNMP.\n"
! 
! #define OPTIONS "\
! -H <ip_address> -o <OID> [-w warn_range] [-c crit_range] \n\
!           [-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] [-P snmp version]\n\
!           [-L seclevel] [-U secname] [-a authproto] [-A authpasswd]\n\
!           [-X privpasswd]\n"
! 
! #define LONGOPTIONS "\
!  -H, --hostname=HOST\n\
!     Name or IP address of the device you wish to query\n\
!  -o, --oid=OID(s)\n\
!     Object identifier(s) whose value you wish to query\n\
!  -w, --warning=INTEGER_RANGE(s)\n\
!     Range(s) which will not result in a WARNING status\n\
!  -c, --critical=INTEGER_RANGE(s)\n\
!     Range(s) which will not result in a CRITICAL status\n\
!  -C, --community=STRING\n\
!     Optional community string for SNMP communication\n\
!     (default is \"%s\")\n\
!  -u, --units=STRING\n\
!     Units label(s) for output data (e.g., 'sec.').\n\
!  -p, --port=STRING\n\
!     UDP port number target is listening on. Default is \"%s\"\n\
   -P, --protocol=[1|3]\n\
      SNMP protocol version\n\
   -L, --seclevel=[noAuthNoPriv|authNoPriv|authPriv]\n\
      SNMPv3 securityLevel\n\
   -U, --secname=USERNAME\n\
      SNMPv3 username\n\
-  -a, --authproto=[MD5|SHA]\n\
-     SNMPv3 auth proto\n\
   -A, --authpassword=PASSWORD\n\
      SNMPv3 authentication password\n\
   -X, --privpasswd=PASSWORD\n\
!     SNMPv3 crypt passwd (DES)\n\
!  -d, --delimiter=STRING\n\
      Delimiter to use when parsing returned data. Default is \"%s\"\n\
      Any data on the right hand side of the delimiter is considered\n\
!     to be the data that should be used in the evaluation.\n\
!  -t, --timeout=INTEGER\n\
!     Seconds to wait before plugin times out (see also nagios server timeout).\n\
!     Default is %d seconds\n\
!  -D, --output-delimiter=STRING\n\
!     Separates output on multiple OID requests\n\
   -s, --string=STRING\n\
      Return OK state (for that OID) if STRING is an exact match\n\
--- 25,117 ----
  
  const char *progname = "check_snmp";
! const char *revision = "$Revision$";
! const char *copyright = "1999-2003";
! const char *email = "nagiosplug-devel at lists.sourceforge.net";
! 
! #define DEFAULT_COMMUNITY "public"
! #define DEFAULT_PORT "161"
! #define DEFAULT_MIBLIST "ALL"
! #define DEFAULT_PROTOCOL "1"
! #define DEFAULT_AUTH_PROTOCOL "MD5"
! #define DEFAULT_DELIMITER "="
! #define DEFAULT_OUTPUT_DELIMITER " "
! 
! #include "common.h"
! #include "utils.h"
! #include "popen.h"
! 
! void
! print_usage (void)
! {
! 	printf ("\
! Usage: %s -H <ip_address> -o <OID> [-w warn_range] [-c crit_range] \n\
!   [-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] [-P snmp version]\n\
!   [-L seclevel] [-U secname] [-a authproto] [-A authpasswd]\n\
!   [-X privpasswd]\n",
! 	        progname);
! 	printf ("\
!        %s (-h | --help) for detailed help\n\
!        %s (-V | --version) for version information\n",
! 	        progname, progname);
! }
! 
! void
! print_help (void)
! {
! 	print_revision (progname, revision);
! 
! 	printf (_(COPYRIGHT), copyright, email);
! 
! 	printf (_("\
! Check status of remote machines and obtain sustem information via SNMP"));
! 
! 	print_usage ();
! 
! 	printf (_(UT_HELP_VRSN));
! 
! 	printf (_(UT_HOST_PORT), 'p', DEFAULT_PORT);
! 
! 	/* SNMP and Authentication Protocol */
! 	printf (_("\
   -P, --protocol=[1|3]\n\
      SNMP protocol version\n\
   -L, --seclevel=[noAuthNoPriv|authNoPriv|authPriv]\n\
      SNMPv3 securityLevel\n\
+  -a, --authproto=[MD5|SHA]\n\
+     SNMPv3 auth proto\n"));
+ 
+ 	/* Authentication Tokens*/
+ 	printf (_("\
+  -C, --community=STRING\n\
+     Optional community string for SNMP communication\n\
+     (default is \"%s\")\n\
   -U, --secname=USERNAME\n\
      SNMPv3 username\n\
   -A, --authpassword=PASSWORD\n\
      SNMPv3 authentication password\n\
   -X, --privpasswd=PASSWORD\n\
!     SNMPv3 crypt passwd (DES)\n"), DEFAULT_COMMUNITY);
! 
! 	/* OID Stuff */
! 	printf (_("\
!  -o, --oid=OID(s)\n\
!     Object identifier(s) whose value you wish to query\n\
!  -m, --miblist=STRING\n\
!     List of MIBS to be loaded (default = ALL)\n -d, --delimiter=STRING\n\
      Delimiter to use when parsing returned data. Default is \"%s\"\n\
      Any data on the right hand side of the delimiter is considered\n\
!     to be the data that should be used in the evaluation.\n"), DEFAULT_DELIMITER);
! 
! 	/* Tests Against Integers */
! 	printf (_("\
!  -w, --warning=INTEGER_RANGE(s)\n\
!     Range(s) which will not result in a WARNING status\n\
!  -c, --critical=INTEGER_RANGE(s)\n\
!     Range(s) which will not result in a CRITICAL status\n"));
! 
! 	/* Tests Against Strings */
! 	printf (_("\
   -s, --string=STRING\n\
      Return OK state (for that OID) if STRING is an exact match\n\
***************
*** 83,104 ****
      Return OK state (for that OID) if case-insensitive extended REGEX matches\n\
   -l, --label=STRING\n\
!     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 "\
  - This plugin uses the 'snmpget' command included with the NET-SNMP package.\n\
    If you don't have the package installed, you will need to download it from\n\
!   http://net-snmp.sourceforge.net before you can use this plugin.\n\
  - Multiple OIDs may be indicated by a comma- or space-delimited list (lists with\n\
!   internal spaces must be quoted) [max 8 OIDs]\n\
  - Ranges are inclusive and are indicated with colons. When specified as\n\
    'min:max' a STATE_OK will be returned if the result is within the indicated\n\
    range or is equal to the upper or lower bound. A non-OK state will be\n\
!   returned if the result is outside the specified range.\n\
  - If specified in the order 'max:min' a non-OK state will be returned if the\n\
!   result is within the (inclusive) range.\n\
  - Upper or lower bounds may be omitted to skip checking the respective limit.\n\
  - Bare integers are interpreted as upper limits.\n\
--- 121,157 ----
      Return OK state (for that OID) if case-insensitive extended REGEX matches\n\
   -l, --label=STRING\n\
!     Prefix label for output from plugin (default -s 'SNMP')\n"));
! 
! 	/* Output Formatting */
! 	printf (_("\
!  -u, --units=STRING\n\
!     Units label(s) for output data (e.g., 'sec.').\n\
!  -D, --output-delimiter=STRING\n\
!     Separates output on multiple OID requests\n"));
  
! 	printf (_(UT_TIMEOUT), DEFAULT_SOCKET_TIMEOUT);
! 
! 	printf (_(UT_VERBOSE));
! 
! 	printf (_("\
  - This plugin uses the 'snmpget' command included with the NET-SNMP package.\n\
    If you don't have the package installed, you will need to download it from\n\
!   http://net-snmp.sourceforge.net before you can use this plugin.\n"));
! 
! 	printf (_("\
  - Multiple OIDs may be indicated by a comma- or space-delimited list (lists with\n\
!   internal spaces must be quoted) [max 8 OIDs]\n"));
! 
! 	printf (_("\
  - Ranges are inclusive and are indicated with colons. When specified as\n\
    'min:max' a STATE_OK will be returned if the result is within the indicated\n\
    range or is equal to the upper or lower bound. A non-OK state will be\n\
!   returned if the result is outside the specified range.\n"));
! 
! 	printf (_("\
  - If specified in the order 'max:min' a non-OK state will be returned if the\n\
!   result is within the (inclusive) range.\n"));
! 
! 	printf (_("\
  - Upper or lower bounds may be omitted to skip checking the respective limit.\n\
  - Bare integers are interpreted as upper limits.\n\
***************
*** 106,124 ****
  - Note that only one string and one regex may be checked at present\n\
  - All evaluation methods other than PR, STR, and SUBSTR expect that the value\n\
!   returned from the SNMP query is an unsigned integer.\n"
! 
! #define DESCRIPTION "\
! This plugin gets system information on a remote server via snmp.\n"
! 
! #define DEFAULT_COMMUNITY "public"
! #define DEFAULT_PORT "161"
! #define DEFAULT_TIMEOUT 10
! #define DEFAULT_MIBLIST "ALL"
! #define DEFAULT_PROTOCOL "1"
! #define DEFAULT_AUTH_PROTOCOL "MD5"
  
! #include "common.h"
! #include "utils.h"
! #include "popen.h"
  
  #define mark(a) ((a)!=0?"*":"")
--- 159,167 ----
  - Note that only one string and one regex may be checked at present\n\
  - All evaluation methods other than PR, STR, and SUBSTR expect that the value\n\
!   returned from the SNMP query is an unsigned integer.\n"));
  
! 	support ();
! }
! 
  
  #define mark(a) ((a)!=0?"*":"")
***************
*** 148,153 ****
  #define MAX_OIDS 8
  #define MAX_DELIM_LENGTH 8
- #define DEFAULT_DELIMITER "="
- #define DEFAULT_OUTPUT_DELIMITER " "
  
  void print_usage (void);
--- 191,194 ----
***************
*** 475,479 ****
  			exit (STATE_OK); 
  		case 'V':	/* version */
! 			print_revision (progname, REVISION);
  			exit (STATE_OK);
  		case 'v': /* verbose */
--- 516,520 ----
  			exit (STATE_OK); 
  		case 'V':	/* version */
! 			print_revision (progname, revision);
  			exit (STATE_OK);
  		case 'v': /* verbose */
***************
*** 746,774 ****
  
  	return OK;
- }
- 
- 
- 
- void
- print_help (void)
- {
- 	print_revision (progname, REVISION);
- 	printf
- 		("Copyright (c) %s %s <%s>\n\n%s\n", COPYRIGHT, AUTHOR, EMAIL, SUMMARY);
- 	print_usage ();
- 	printf
- 		("\nOptions:\n" LONGOPTIONS "\n" DESCRIPTION "\n" NOTES "\n", 
- 		 DEFAULT_COMMUNITY, DEFAULT_PORT, DEFAULT_DELIMITER, DEFAULT_TIMEOUT);
- 	support ();
- }
- 
- void
- print_usage (void)
- {
- 	printf
- 		("Usage:\n" " %s %s\n"
- 		 " %s (-h | --help) for detailed help\n"
- 		 " %s (-V | --version) for version information\n",
- 		 progname, OPTIONS, progname, progname);
  }
  
--- 787,790 ----





More information about the Commits mailing list