diff options
Diffstat (limited to 'plugins')
| -rw-r--r-- | plugins/check_snmp.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/plugins/check_snmp.c b/plugins/check_snmp.c index 35e1f339..3403eee6 100644 --- a/plugins/check_snmp.c +++ b/plugins/check_snmp.c | |||
| @@ -68,9 +68,15 @@ const char *email = "devel@monitoring-plugins.org"; | |||
| 68 | const char DEFAULT_COMMUNITY[] = "public"; | 68 | const char DEFAULT_COMMUNITY[] = "public"; |
| 69 | const char DEFAULT_MIBLIST[] = "ALL"; | 69 | const char DEFAULT_MIBLIST[] = "ALL"; |
| 70 | #define DEFAULT_AUTH_PROTOCOL "MD5" | 70 | #define DEFAULT_AUTH_PROTOCOL "MD5" |
| 71 | #define DEFAULT_PRIV_PROTOCOL "DES" | 71 | |
| 72 | #define DEFAULT_DELIMITER "=" | 72 | #ifdef usmDESPrivProtocol |
| 73 | #define DEFAULT_BUFFER_SIZE 100 | 73 | # define DEFAULT_PRIV_PROTOCOL "DES" |
| 74 | #else | ||
| 75 | # define DEFAULT_PRIV_PROTOCOL "AES" | ||
| 76 | #endif | ||
| 77 | |||
| 78 | #define DEFAULT_DELIMITER "=" | ||
| 79 | #define DEFAULT_BUFFER_SIZE 100 | ||
| 74 | 80 | ||
| 75 | /* Longopts only arguments */ | 81 | /* Longopts only arguments */ |
| 76 | #define L_INVERT_SEARCH CHAR_MAX + 3 | 82 | #define L_INVERT_SEARCH CHAR_MAX + 3 |
| @@ -617,8 +623,12 @@ static process_arguments_wrapper process_arguments(int argc, char **argv) { | |||
| 617 | break; | 623 | break; |
| 618 | case 'x': /* priv protocol */ | 624 | case 'x': /* priv protocol */ |
| 619 | if (strcasecmp("DES", optarg) == 0) { | 625 | if (strcasecmp("DES", optarg) == 0) { |
| 626 | #ifdef usmDESPrivProtocol | ||
| 620 | config.snmp_session.securityAuthProto = usmDESPrivProtocol; | 627 | config.snmp_session.securityAuthProto = usmDESPrivProtocol; |
| 621 | config.snmp_session.securityAuthProtoLen = OID_LENGTH(usmDESPrivProtocol); | 628 | config.snmp_session.securityAuthProtoLen = OID_LENGTH(usmDESPrivProtocol); |
| 629 | #else | ||
| 630 | die(STATE_UNKNOWN, "DES Privacy Protocol not available on this platform"); | ||
| 631 | #endif | ||
| 622 | } else if (strcasecmp("AES", optarg) == 0) { | 632 | } else if (strcasecmp("AES", optarg) == 0) { |
| 623 | config.snmp_session.securityAuthProto = usmAESPrivProtocol; | 633 | config.snmp_session.securityAuthProto = usmAESPrivProtocol; |
| 624 | config.snmp_session.securityAuthProtoLen = OID_LENGTH(usmAESPrivProtocol); | 634 | config.snmp_session.securityAuthProtoLen = OID_LENGTH(usmAESPrivProtocol); |
| @@ -987,8 +997,13 @@ void print_help(void) { | |||
| 987 | printf(" %s\n", _("SNMPv3 securityLevel")); | 997 | printf(" %s\n", _("SNMPv3 securityLevel")); |
| 988 | printf(" %s\n", "-a, --authproto=[MD5|SHA]"); | 998 | printf(" %s\n", "-a, --authproto=[MD5|SHA]"); |
| 989 | printf(" %s\n", _("SNMPv3 auth proto")); | 999 | printf(" %s\n", _("SNMPv3 auth proto")); |
| 1000 | #ifdef usmDESPrivProtocol | ||
| 990 | printf(" %s\n", "-x, --privproto=[DES|AES]"); | 1001 | printf(" %s\n", "-x, --privproto=[DES|AES]"); |
| 991 | printf(" %s\n", _("SNMPv3 priv proto (default DES)")); | 1002 | printf(" %s\n", _("SNMPv3 priv proto (default DES)")); |
| 1003 | #else | ||
| 1004 | printf(" %s\n", "-x, --privproto=[AES]"); | ||
| 1005 | printf(" %s\n", _("SNMPv3 priv proto (default AES)")); | ||
| 1006 | #endif | ||
| 992 | 1007 | ||
| 993 | /* Authentication Tokens*/ | 1008 | /* Authentication Tokens*/ |
| 994 | printf(" %s\n", "-C, --community=STRING"); | 1009 | printf(" %s\n", "-C, --community=STRING"); |
