(plugin) network:🇦🇼:aoscx::snmp - fix temperature value (#3788)
This commit is contained in:
parent
fb928e0db7
commit
f59d16d7c1
|
@ -74,8 +74,8 @@ sub check {
|
|||
)
|
||||
);
|
||||
}
|
||||
|
||||
next if (!defined($result->{speed}));
|
||||
|
||||
next if (!defined($result->{speed}) || $result->{speed} =~ /^0$/);
|
||||
|
||||
my ($exit2, $warn, $crit, $checked) = $self->get_severity_numeric(section => 'fan.speed', instance => $instance, name => $result->{name}, value => $result->{speed});
|
||||
if (!$self->{output}->is_status(value => $exit2, compare => 'ok', litteral => 1)) {
|
||||
|
@ -88,6 +88,7 @@ sub check {
|
|||
)
|
||||
);
|
||||
}
|
||||
|
||||
$self->{output}->perfdata_add(
|
||||
unit => 'rpm',
|
||||
nlabel => 'hardware.fan.speed.rpm',
|
||||
|
|
|
@ -76,7 +76,7 @@ sub check {
|
|||
}
|
||||
|
||||
next if (!defined($result->{power}) || $result->{power} =~ /^0$/);
|
||||
|
||||
|
||||
my ($exit2, $warn, $crit, $checked) = $self->get_severity_numeric(section => 'psu.power', instance => $instance, name => $result->{name}, value => $result->{power});
|
||||
if (!$self->{output}->is_status(value => $exit2, compare => 'ok', litteral => 1)) {
|
||||
$self->{output}->output_add(
|
||||
|
|
|
@ -55,9 +55,11 @@ sub check {
|
|||
next if ($self->check_filter(section => 'temperature', instance => $instance, name => $result->{name}));
|
||||
$self->{components}->{temperature}->{total}++;
|
||||
|
||||
$result->{temperature} /= 1000;
|
||||
|
||||
$self->{output}->output_add(
|
||||
long_msg => sprintf(
|
||||
"temperature '%s' status is %s [instance: %s, current: %s C]",
|
||||
"temperature '%s' status is %s [instance: %s, current: %.2f C]",
|
||||
$result->{name},
|
||||
$result->{state},
|
||||
$instance,
|
||||
|
@ -82,7 +84,7 @@ sub check {
|
|||
$self->{output}->output_add(
|
||||
severity => $exit2,
|
||||
short_msg => sprintf(
|
||||
"temperature '%s' is %s C",
|
||||
"temperature '%s' is %.2f C",
|
||||
$result->{name},
|
||||
$result->{temperature}
|
||||
)
|
||||
|
@ -92,10 +94,9 @@ sub check {
|
|||
unit => 'C',
|
||||
nlabel => 'hardware.temperature.celsius',
|
||||
instances => $result->{name},
|
||||
value => $result->{temperature},
|
||||
value => sprintf('%.2f', $result->{temperature}),
|
||||
warning => $warn,
|
||||
critical => $crit,
|
||||
min => 0
|
||||
critical => $crit
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue