enh(hp/ilo/restapi): hardware - add default warning temperature threshold (#3014)

This commit is contained in:
qgarnier 2021-08-04 09:45:32 +02:00 committed by GitHub
parent 66cf4671a7
commit 5edae35ad8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 7 deletions

View File

@ -78,6 +78,7 @@ sub check {
my $crit_th = defined($temp->{UpperThresholdFatal}) ? ':' . $temp->{UpperThresholdFatal} : '';
$self->{perfdata}->threshold_validate(label => 'warning-temperature-instance-' . $instance, value => $warn_th);
$self->{perfdata}->threshold_validate(label => 'critical-temperature-instance-' . $instance, value => $crit_th);
$warn = $self->{perfdata}->get_perfdata_for_output(label => 'warning-temperature-instance-' . $instance);
$crit = $self->{perfdata}->get_perfdata_for_output(label => 'critical-temperature-instance-' . $instance);
}
@ -96,7 +97,7 @@ sub check {
instances => [$chassis_name, $temp_name],
value => $temp->{ReadingCelsius},
warning => $warn,
critical => $crit,
critical => $crit
);
}
}

View File

@ -30,11 +30,11 @@ sub new {
bless $self, $class;
$self->{version} = '0.1';
%{ $self->{modes} } = (
'hardware' => 'centreon::common::redfish::restapi::mode::hardware',
);
$self->{modes} = {
'hardware' => 'centreon::common::redfish::restapi::mode::hardware'
};
$self->{custom_modes}{api} = 'hardware::server::hp::ilo::restapi::custom::api';
$self->{custom_modes}->{api} = 'hardware::server::hp::ilo::restapi::custom::api';
return $self;
}