summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: afb0e81)
raw | patch | inline | side by side (parent: afb0e81)
author | Subhendu Ghosh <sghosh@users.sourceforge.net> | |
Wed, 25 May 2005 15:40:32 +0000 (15:40 +0000) | ||
committer | Subhendu Ghosh <sghosh@users.sourceforge.net> | |
Wed, 25 May 2005 15:40:32 +0000 (15:40 +0000) |
git-svn-id: https://nagiosplug.svn.sourceforge.net/svnroot/nagiosplug/nagiosplug/trunk@1182 f882894a-f735-0410-b71e-b25c423dba1c
plugins/check_snmp.c | patch | blob | history |
diff --git a/plugins/check_snmp.c b/plugins/check_snmp.c
index 5d65113f4046e7fa5c25ab4b73b690f00b566de6..728d692ac19a9e1b15adfcb1e90f4468722c69f8 100644 (file)
--- a/plugins/check_snmp.c
+++ b/plugins/check_snmp.c
size_t nunits = 0;
size_t unitv_size = 8;
int verbose = FALSE;
+int usesnmpgetnext = FALSE;
unsigned long lower_warn_lim[MAX_OIDS];
unsigned long upper_warn_lim[MAX_OIDS];
unsigned long lower_crit_lim[MAX_OIDS];
usage4 (_("Could not parse arguments"));
/* create the command line to execute */
- asprintf (&command_line, "%s -t %d -r %d -m %s -v %s %s %s:%s %s",
+ if(usesnmpgetnext == TRUE) {
+ asprintf(&command_line, "%s -t %d -r %d -m %s -v %s %s %s:%s %s",
+ PATH_TO_SNMPGETNEXT, timeout_interval, retries, miblist, proto,
+ authpriv, server_address, port, oid);
+ }else{
+
+ asprintf (&command_line, "%s -t %d -r %d -m %s -v %s %s %s:%s %s",
PATH_TO_SNMPGET, timeout_interval, retries, miblist, proto,
authpriv, server_address, port, oid);
+ }
+
if (verbose)
printf ("%s\n", command_line);
+
/* run the command */
child_process = spopen (command_line);
{"authproto", required_argument, 0, 'a'},
{"authpasswd", required_argument, 0, 'A'},
{"privpasswd", required_argument, 0, 'X'},
+ {"next", no_argument, 0, 'n'},
{0, 0, 0, 0}
};
}
while (1) {
- c = getopt_long (argc, argv, "hvVt:c:w:H:C:o:e:E:d:D:s:t:R:r:l:u:p:m:P:L:U:a:A:X:",
+ c = getopt_long (argc, argv, "nhvVt:c:w:H:C:o:e:E:d:D:s:t:R:r:l:u:p:m:P:L:U:a:A:X:",
longopts, &option);
if (c == -1 || c == EOF)
case 'm': /* List of MIBS */
miblist = optarg;
break;
+ case 'n': /* usesnmpgetnext */
+ usesnmpgetnext = TRUE;
+ break;
case 'P': /* SNMP protocol version */
proto = optarg;
break;
/* SNMP and Authentication Protocol */
printf (_("\
+ -n, --next\n\
+ Use SNMP GETNEXT instead of SNMP GET\n\
-P, --protocol=[1|2c|3]\n\
SNMP protocol version\n\
-L, --seclevel=[noAuthNoPriv|authNoPriv|authPriv]\n\