mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-27 07:34:35 +02:00
enh(qnap): memory mode - add a --force-counters-legacy (#2880)
as a workaround to memory buggy counters
This commit is contained in:
parent
c130e895df
commit
429a1174cd
@ -78,6 +78,10 @@ sub new {
|
|||||||
my $self = $class->SUPER::new(package => __PACKAGE__, %options, force_new_perfdata => 1);
|
my $self = $class->SUPER::new(package => __PACKAGE__, %options, force_new_perfdata => 1);
|
||||||
bless $self, $class;
|
bless $self, $class;
|
||||||
|
|
||||||
|
$options{options}->add_options(arguments => {
|
||||||
|
'force-counters-legacy' => { name => 'force_counters_legacy' }
|
||||||
|
});
|
||||||
|
|
||||||
return $self;
|
return $self;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -149,8 +153,10 @@ sub manage_selection {
|
|||||||
oids => [ map($_->{oid} . '.0', values(%{$mapping->{legacy}}), values(%{$mapping->{ex}}), values(%{$mapping->{es}})) ],
|
oids => [ map($_->{oid} . '.0', values(%{$mapping->{legacy}}), values(%{$mapping->{ex}}), values(%{$mapping->{es}})) ],
|
||||||
nothing_quit => 1
|
nothing_quit => 1
|
||||||
);
|
);
|
||||||
|
if (!defined($self->{option_results}->{force_counters_legacy})) {
|
||||||
$self->check_memory(snmp => $options{snmp}, type => 'ex', snmp_result => $snmp_result);
|
$self->check_memory(snmp => $options{snmp}, type => 'ex', snmp_result => $snmp_result);
|
||||||
$self->check_memory(snmp => $options{snmp}, type => 'es', snmp_result => $snmp_result, convert => 1);
|
$self->check_memory(snmp => $options{snmp}, type => 'es', snmp_result => $snmp_result, convert => 1);
|
||||||
|
}
|
||||||
$self->check_memory(snmp => $options{snmp}, type => 'legacy', snmp_result => $snmp_result, convert => 1);
|
$self->check_memory(snmp => $options{snmp}, type => 'legacy', snmp_result => $snmp_result, convert => 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -164,6 +170,10 @@ Check memory.
|
|||||||
|
|
||||||
=over 8
|
=over 8
|
||||||
|
|
||||||
|
=item B<--force-counters-legacy>
|
||||||
|
|
||||||
|
Force to use legacy counters. Should be used when EX/ES counters are buggy.
|
||||||
|
|
||||||
=item B<--warning-*> B<--critical-*>
|
=item B<--warning-*> B<--critical-*>
|
||||||
|
|
||||||
Thresholds.
|
Thresholds.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user