summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: f8b606b)
raw | patch | inline | side by side (parent: f8b606b)
author | Ton Voon <tonvoon@macbook.local> | |
Tue, 23 Dec 2008 11:52:04 +0000 (11:52 +0000) | ||
committer | Ton Voon <tonvoon@macbook.local> | |
Tue, 23 Dec 2008 11:52:04 +0000 (11:52 +0000) |
for compatibility
plugins/check_snmp.c | patch | blob | history |
diff --git a/plugins/check_snmp.c b/plugins/check_snmp.c
index 1c92534c284e52df0ef3f4a4f24f3a4b148de22e..a19da90927fe6540f94461610ae33220368cc280 100644 (file)
--- a/plugins/check_snmp.c
+++ b/plugins/check_snmp.c
#define DEFAULT_TIMEOUT 1
#define DEFAULT_RETRIES 5
#define DEFAULT_AUTH_PROTOCOL "MD5"
+#define DEFAULT_PRIV_PROTOCOL "DES"
#define DEFAULT_DELIMITER "="
#define DEFAULT_OUTPUT_DELIMITER " "
char *seclevel = NULL;
char *secname = NULL;
char *authproto = NULL;
+char *privproto = NULL;
char *authpasswd = NULL;
char *privpasswd = NULL;
char *oid;
{"seclevel", required_argument, 0, 'L'},
{"secname", required_argument, 0, 'U'},
{"authproto", required_argument, 0, 'a'},
+ {"privproto", required_argument, 0, 'x'},
{"authpasswd", required_argument, 0, 'A'},
{"privpasswd", required_argument, 0, 'X'},
{"next", no_argument, 0, 'n'},
}
while (1) {
- 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:",
+ 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:x:A:X:",
longopts, &option);
if (c == -1 || c == EOF)
case 'a': /* auth protocol */
authproto = optarg;
break;
+ case 'x': /* priv protocol */
+ privproto = optarg;
+ break;
case 'A': /* auth passwd */
authpasswd = optarg;
break;
if (authproto == NULL )
asprintf(&authproto, DEFAULT_AUTH_PROTOCOL);
-
+ if (privproto == NULL )
+ asprintf(&privproto, DEFAULT_PRIV_PROTOCOL);
if (proto == NULL || (strcmp(proto,DEFAULT_PROTOCOL) == 0) ) { /* default protocol version */
asprintf(&proto, DEFAULT_PROTOCOL);
print_usage ();
exit (STATE_UNKNOWN);
}
- asprintf(&authpriv, "-l authPriv -a %s -u %s -A %s -x DES -X %s ", authproto, secname, authpasswd, privpasswd);
+ asprintf(&authpriv, "-l authPriv -a %s -u %s -A %s -x %s -X %s ", authproto, secname, authpasswd, privproto, privpasswd);
}
}
printf (" %s\n", _("SNMPv3 securityLevel"));
printf (" %s\n", "-a, --authproto=[MD5|SHA]");
printf (" %s\n", _("SNMPv3 auth proto"));
+ printf (" %s\n", "-x, --privproto=[DES|AES]");
+ printf (" %s\n", _("SNMPv3 priv proto (default DES)"));
/* Authentication Tokens*/
printf (" %s\n", "-C, --community=STRING");
printf ("[-C community] [-s string] [-r regex] [-R regexi] [-t timeout] [-e retries]\n");
printf ("[-l label] [-u units] [-p port-number] [-d delimiter] [-D output-delimiter]\n");
printf ("[-m miblist] [-P snmp version] [-L seclevel] [-U secname] [-a authproto]\n");
- printf ("[-A authpasswd] [-X privpasswd]\n");
+ printf ("[-A authpasswd] [-x privproto] [-X privpasswd]\n");
}