aboutsummaryrefslogtreecommitdiff
path: root/plugins/check_snmp.c
diff options
context:
space:
mode:
authorGravatar Mark Keisler <grimm26@gmail.com> 2013-03-14 10:59:58 -0500
committerGravatar Holger Weiss <holger@zedat.fu-berlin.de> 2013-08-18 19:07:24 +0200
commit37cf5e3cd578851fe0bee6b1332f2e8688af64ab (patch)
tree3a32e3eb4270c9dfd0461e5b1075ed735d3e53b4 /plugins/check_snmp.c
parent61656aee4d39be1b037a39d7486b7c12701a5a5c (diff)
downloadmonitoring-plugins-37cf5e3cd578851fe0bee6b1332f2e8688af64ab.tar.gz
Add -Le option to snmpcmd to avoid error message of 'No Log Handling Enabled...'
Diffstat (limited to 'plugins/check_snmp.c')
-rw-r--r--plugins/check_snmp.c27
1 files changed, 14 insertions, 13 deletions
diff --git a/plugins/check_snmp.c b/plugins/check_snmp.c
index 7c5d0ec5..b79c0200 100644
--- a/plugins/check_snmp.c
+++ b/plugins/check_snmp.c
@@ -277,32 +277,33 @@ main (int argc, char **argv)
/* 9 arguments to pass before authpriv options + 1 for host and numoids. Add one for terminating NULL */
command_line = calloc (9 + numauthpriv + 1 + numoids + 1, sizeof (char *));
command_line[0] = snmpcmd;
- command_line[1] = strdup ("-t");
- xasprintf (&command_line[2], "%d", timeout_interval);
- command_line[3] = strdup ("-r");
- xasprintf (&command_line[4], "%d", retries);
- command_line[5] = strdup ("-m");
- command_line[6] = strdup (miblist);
- command_line[7] = "-v";
- command_line[8] = strdup (proto);
+ command_line[1] = strdup ("-Le");
+ command_line[2] = strdup ("-t");
+ xasprintf (&command_line[3], "%d", timeout_interval);
+ command_line[4] = strdup ("-r");
+ xasprintf (&command_line[5], "%d", retries);
+ command_line[6] = strdup ("-m");
+ command_line[7] = strdup (miblist);
+ command_line[8] = "-v";
+ command_line[9] = strdup (proto);
for (i = 0; i < numauthpriv; i++) {
- command_line[9 + i] = authpriv[i];
+ command_line[10 + i] = authpriv[i];
}
- xasprintf (&command_line[9 + numauthpriv], "%s:%s", server_address, port);
+ xasprintf (&command_line[10 + numauthpriv], "%s:%s", server_address, port);
/* This is just for display purposes, so it can remain a string */
- xasprintf(&cl_hidden_auth, "%s -t %d -r %d -m %s -v %s %s %s:%s",
+ xasprintf(&cl_hidden_auth, "%s -Le -t %d -r %d -m %s -v %s %s %s:%s",
snmpcmd, timeout_interval, retries, strlen(miblist) ? miblist : "''", proto, "[authpriv]",
server_address, port);
for (i = 0; i < numoids; i++) {
- command_line[9 + numauthpriv + 1 + i] = oids[i];
+ command_line[10 + numauthpriv + 1 + i] = oids[i];
xasprintf(&cl_hidden_auth, "%s %s", cl_hidden_auth, oids[i]);
}
- command_line[9 + numauthpriv + 1 + numoids] = NULL;
+ command_line[10 + numauthpriv + 1 + numoids] = NULL;
if (verbose)
printf ("%s\n", cl_hidden_auth);