Merge pull request #934 from cgagnaire/849-apc-sensors-display-values

Improve apc sensors mode
This commit is contained in:
Simon Bomm 2018-04-03 22:28:22 +02:00 committed by GitHub
commit c7a6dda810
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 2 deletions

View File

@ -141,8 +141,10 @@ sub check {
next if ($self->check_filter(section => 'sensor', instance => $instance));
$self->{components}->{sensor}->{total}++;
$self->{output}->output_add(long_msg => sprintf("sensor '%s' status is '%s' [instance = %s]",
$result->{uioSensorStatusSensorName}, $result->{uioSensorStatusAlarmStatus}, $instance));
$self->{output}->output_add(long_msg => sprintf("sensor '%s' status is '%s' [instance = %s] [temperature = %s C] [humidity = %s %%]",
$result->{uioSensorStatusSensorName}, $result->{uioSensorStatusAlarmStatus}, $instance,
$result->{uioSensorStatusTemperatureDegC} != -1 ? $result->{uioSensorStatusTemperatureDegC} : '-',
$result->{uioSensorStatusHumidity} != -1 ? $result->{uioSensorStatusHumidity} : '-'));
$exit = $self->get_severity(section => 'sensor', value => $result->{uioSensorStatusAlarmStatus});
if (!$self->{output}->is_status(value => $exit, compare => 'ok', litteral => 1)) {
$self->{output}->output_add(severity => $exit,