improve apc sensors mode

This commit is contained in:
cgagnaire 2018-03-30 16:19:22 +02:00
parent e0414e65bc
commit 31f8fbd6fd
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,