mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-30 09:05:19 +02:00
fix(hardware::server::huawei::hmm::snmp): fixed temperature issue and work on hardware template issue
This commit is contained in:
parent
f729a24ccb
commit
1b91897ae0
@ -137,12 +137,18 @@ sub check_options {
|
||||
my ($self, %options) = @_;
|
||||
$self->SUPER::init(%options);
|
||||
|
||||
if (defined($self->{option_results}->{no_component})) {
|
||||
if ($self->{option_results}->{no_component} ne '') {
|
||||
$self->{no_components} = $self->{option_results}->{no_component};
|
||||
} else {
|
||||
$self->{no_components} = 'critical';
|
||||
}
|
||||
use Data::Dumper;
|
||||
print Dumper("Hardware template check_options start here");
|
||||
|
||||
print Dumper("\$self->{option_results}->{no_component} is defined ? ".defined($self->{option_results}->{no_component}));
|
||||
print Dumper("\$self->{option_results}->{no_component} ne '' ? ".($self->{option_results}->{no_component} ne ''));
|
||||
|
||||
if (defined($self->{option_results}->{no_component}) && ($self->{option_results}->{no_component} ne '')) {
|
||||
$self->{no_components} = $self->{option_results}->{no_component};
|
||||
} else {
|
||||
print Dumper("\$self->{option_results}->{no_component} not defined so set as critical");
|
||||
$self->{no_components} = 'critical';
|
||||
print Dumper("\$self->{no_components} =".$self->{no_components});
|
||||
}
|
||||
|
||||
if ($self->{filter_exclude} == 1) {
|
||||
@ -319,6 +325,10 @@ sub display {
|
||||
);
|
||||
}
|
||||
|
||||
print Dumper("\$total_components = ".$total_components);
|
||||
print Dumper("(option set by the user) : \$self->{option_results}->{no_component} = ".$self->{option_results}->{no_component});
|
||||
print Dumper("(option in self after check_option function) : \$self->{no_components} = ".$self->{no_components});
|
||||
|
||||
if (defined($self->{option_results}->{no_component}) && $total_components == 0) {
|
||||
$self->{output}->output_add(
|
||||
severity => $self->{no_components},
|
||||
|
@ -48,7 +48,7 @@ sub check {
|
||||
return if ($self->check_filter(section => 'temperature'));
|
||||
|
||||
foreach my $oid ($self->{snmp}->oid_lex_sort(keys %{$self->{results}->{$oid_bladeTemperatureTable}})) {
|
||||
next if ($oid !~ /^$mapping->{oid_bladeTemperatureTable}->{oid}\.(.*)$/);
|
||||
next if ($oid !~ /^$mapping->{bladeTemperatureIndex}->{oid}\.(.*)$/);
|
||||
my $instance = $1;
|
||||
my $result = $self->{snmp}->map_instance(mapping => $mapping, results => $self->{results}->{$oid_bladeTemperatureTable}, instance => $instance);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user