mirror of
https://github.com/centreon/centreon-plugins.git
synced 2025-07-25 06:35:38 +02:00
enh(hp/ilo/restapi): hardware - add default warning temperature threshold (#3014)
This commit is contained in:
parent
66cf4671a7
commit
5edae35ad8
@ -45,7 +45,7 @@ sub check {
|
|||||||
$temp->{Status}->{Health} = defined($temp->{Status}->{Health}) ? $temp->{Status}->{Health} : 'n/a';
|
$temp->{Status}->{Health} = defined($temp->{Status}->{Health}) ? $temp->{Status}->{Health} : 'n/a';
|
||||||
next if ($self->check_filter(section => 'temperature', instance => $instance));
|
next if ($self->check_filter(section => 'temperature', instance => $instance));
|
||||||
$self->{components}->{temperature}->{total}++;
|
$self->{components}->{temperature}->{total}++;
|
||||||
|
|
||||||
$self->{output}->output_add(
|
$self->{output}->output_add(
|
||||||
long_msg => sprintf(
|
long_msg => sprintf(
|
||||||
"temperature '%s/%s' status is '%s' [instance: %s, state: %s, value: %s]",
|
"temperature '%s/%s' status is '%s' [instance: %s, state: %s, value: %s]",
|
||||||
@ -78,9 +78,10 @@ sub check {
|
|||||||
my $crit_th = defined($temp->{UpperThresholdFatal}) ? ':' . $temp->{UpperThresholdFatal} : '';
|
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 => 'warning-temperature-instance-' . $instance, value => $warn_th);
|
||||||
$self->{perfdata}->threshold_validate(label => 'critical-temperature-instance-' . $instance, value => $crit_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);
|
$crit = $self->{perfdata}->get_perfdata_for_output(label => 'critical-temperature-instance-' . $instance);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!$self->{output}->is_status(value => $exit2, compare => 'ok', litteral => 1)) {
|
if (!$self->{output}->is_status(value => $exit2, compare => 'ok', litteral => 1)) {
|
||||||
$self->{output}->output_add(
|
$self->{output}->output_add(
|
||||||
severity => $exit2,
|
severity => $exit2,
|
||||||
@ -96,7 +97,7 @@ sub check {
|
|||||||
instances => [$chassis_name, $temp_name],
|
instances => [$chassis_name, $temp_name],
|
||||||
value => $temp->{ReadingCelsius},
|
value => $temp->{ReadingCelsius},
|
||||||
warning => $warn,
|
warning => $warn,
|
||||||
critical => $crit,
|
critical => $crit
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -30,11 +30,11 @@ sub new {
|
|||||||
bless $self, $class;
|
bless $self, $class;
|
||||||
|
|
||||||
$self->{version} = '0.1';
|
$self->{version} = '0.1';
|
||||||
%{ $self->{modes} } = (
|
$self->{modes} = {
|
||||||
'hardware' => 'centreon::common::redfish::restapi::mode::hardware',
|
'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;
|
return $self;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user