Change snmpv3 management parameters (PR #1392)
This commit is contained in:
parent
d8fd6ec68d
commit
858075ec68
|
@ -791,7 +791,9 @@ sub check_options {
|
||||||
return ;
|
return ;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (defined($options{option_results}->{snmp_auth_passphrase}) && !defined($options{option_results}->{snmp_auth_protocol})) {
|
my $user_activate = 0;
|
||||||
|
if (defined($options{option_results}->{snmp_auth_passphrase}) && $options{option_results}->{snmp_auth_passphrase} ne '') {
|
||||||
|
if (!defined($options{option_results}->{snmp_auth_protocol})) {
|
||||||
$self->{output}->add_option_msg(short_msg => "Missing parameter authenticate protocol.");
|
$self->{output}->add_option_msg(short_msg => "Missing parameter authenticate protocol.");
|
||||||
$self->{output}->option_exit();
|
$self->{output}->option_exit();
|
||||||
}
|
}
|
||||||
|
@ -804,19 +806,24 @@ sub check_options {
|
||||||
$self->{snmp_params}->{SecLevel} = 'authNoPriv';
|
$self->{snmp_params}->{SecLevel} = 'authNoPriv';
|
||||||
$self->{snmp_params}->{AuthProto} = $options{option_results}->{snmp_auth_protocol};
|
$self->{snmp_params}->{AuthProto} = $options{option_results}->{snmp_auth_protocol};
|
||||||
$self->{snmp_params}->{AuthPass} = $options{option_results}->{snmp_auth_passphrase};
|
$self->{snmp_params}->{AuthPass} = $options{option_results}->{snmp_auth_passphrase};
|
||||||
|
$user_activate = 1;
|
||||||
|
}
|
||||||
|
|
||||||
if (defined($options{option_results}->{snmp_priv_passphrase}) && !defined($options{option_results}->{snmp_priv_protocol})) {
|
if (defined($options{option_results}->{snmp_priv_passphrase}) && $options{option_results}->{snmp_priv_passphrase} ne '') {
|
||||||
|
if (!defined($options{option_results}->{snmp_priv_protocol})) {
|
||||||
$self->{output}->add_option_msg(short_msg => "Missing parameter privacy protocol.");
|
$self->{output}->add_option_msg(short_msg => "Missing parameter privacy protocol.");
|
||||||
$self->{output}->option_exit();
|
$self->{output}->option_exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (defined($options{option_results}->{snmp_priv_protocol})) {
|
|
||||||
$options{option_results}->{snmp_priv_protocol} = uc($options{option_results}->{snmp_priv_protocol});
|
$options{option_results}->{snmp_priv_protocol} = uc($options{option_results}->{snmp_priv_protocol});
|
||||||
if ($options{option_results}->{snmp_priv_protocol} ne 'DES' && $options{option_results}->{snmp_priv_protocol} ne 'AES') {
|
if ($options{option_results}->{snmp_priv_protocol} ne 'DES' && $options{option_results}->{snmp_priv_protocol} ne 'AES') {
|
||||||
$self->{output}->add_option_msg(short_msg => "Wrong privacy protocol. Must be DES or AES.");
|
$self->{output}->add_option_msg(short_msg => "Wrong privacy protocol. Must be DES or AES.");
|
||||||
$self->{output}->option_exit();
|
$self->{output}->option_exit();
|
||||||
}
|
}
|
||||||
|
if ($user_activate == 0) {
|
||||||
|
$self->{output}->add_option_msg(short_msg => "Cannot use snmp v3 privacy option without snmp v3 authentification options.");
|
||||||
|
$self->{output}->option_exit();
|
||||||
|
}
|
||||||
$self->{snmp_params}->{SecLevel} = 'authPriv';
|
$self->{snmp_params}->{SecLevel} = 'authPriv';
|
||||||
$self->{snmp_params}->{PrivPass} = $options{option_results}->{snmp_priv_passphrase};
|
$self->{snmp_params}->{PrivPass} = $options{option_results}->{snmp_priv_passphrase};
|
||||||
$self->{snmp_params}->{PrivProto} = $options{option_results}->{snmp_priv_protocol};
|
$self->{snmp_params}->{PrivProto} = $options{option_results}->{snmp_priv_protocol};
|
||||||
|
|
Loading…
Reference in New Issue