enh(qnap/snmp): mode volumes - add --force-counters-legacy option (#3309)
This commit is contained in:
parent
c3b419e604
commit
6ab0d8baf2
|
@ -131,7 +131,8 @@ sub new {
|
||||||
bless $self, $class;
|
bless $self, $class;
|
||||||
|
|
||||||
$options{options}->add_options(arguments => {
|
$options{options}->add_options(arguments => {
|
||||||
'filter-name:s' => { name => 'filter_name' }
|
'filter-name:s' => { name => 'filter_name' },
|
||||||
|
'force-counters-legacy' => { name => 'force_counters_legacy' }
|
||||||
});
|
});
|
||||||
|
|
||||||
return $self;
|
return $self;
|
||||||
|
@ -228,7 +229,9 @@ sub manage_selection {
|
||||||
|
|
||||||
$self->{volumes} = {};
|
$self->{volumes} = {};
|
||||||
|
|
||||||
my $snmp_result = $options{snmp}->get_table(
|
my $snmp_result;
|
||||||
|
if (!defined($self->{option_results}->{force_counters_legacy})) {
|
||||||
|
$snmp_result = $options{snmp}->get_table(
|
||||||
oid => '.1.3.6.1.4.1.55062.1.10.9' # volumeTable
|
oid => '.1.3.6.1.4.1.55062.1.10.9' # volumeTable
|
||||||
);
|
);
|
||||||
return if ($self->check_volumes(snmp => $options{snmp}, type => 'qts', snmp_result => $snmp_result));
|
return if ($self->check_volumes(snmp => $options{snmp}, type => 'qts', snmp_result => $snmp_result));
|
||||||
|
@ -237,6 +240,7 @@ sub manage_selection {
|
||||||
oid => '.1.3.6.1.4.1.24681.1.4.1.1.1.2.3.2' # volumeTable
|
oid => '.1.3.6.1.4.1.24681.1.4.1.1.1.2.3.2' # volumeTable
|
||||||
);
|
);
|
||||||
return if ($self->check_volumes(snmp => $options{snmp}, type => 'ex', snmp_result => $snmp_result));
|
return if ($self->check_volumes(snmp => $options{snmp}, type => 'ex', snmp_result => $snmp_result));
|
||||||
|
}
|
||||||
|
|
||||||
$snmp_result = $options{snmp}->get_table(
|
$snmp_result = $options{snmp}->get_table(
|
||||||
oid => '.1.3.6.1.4.1.24681.1.2.17', # systemVolumeTable
|
oid => '.1.3.6.1.4.1.24681.1.2.17', # systemVolumeTable
|
||||||
|
@ -259,6 +263,10 @@ Check volumes.
|
||||||
|
|
||||||
Filter volumes by name (can be a regexp).
|
Filter volumes by name (can be a regexp).
|
||||||
|
|
||||||
|
=item B<--force-counters-legacy>
|
||||||
|
|
||||||
|
Force to use legacy counters. Should be used when EX/QTS counters are buggy.
|
||||||
|
|
||||||
=item B<--unknown-volume-status>
|
=item B<--unknown-volume-status>
|
||||||
|
|
||||||
Set unknown threshold for status.
|
Set unknown threshold for status.
|
||||||
|
|
Loading…
Reference in New Issue