From 31f8fbd6fdafd67cebfd8226dd1f366aa90bc95b Mon Sep 17 00:00:00 2001 From: cgagnaire Date: Fri, 30 Mar 2018 16:19:22 +0200 Subject: [PATCH] improve apc sensors mode --- hardware/ups/apc/snmp/mode/sensors.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hardware/ups/apc/snmp/mode/sensors.pm b/hardware/ups/apc/snmp/mode/sensors.pm index 556cb5039..7d141d4ac 100644 --- a/hardware/ups/apc/snmp/mode/sensors.pm +++ b/hardware/ups/apc/snmp/mode/sensors.pm @@ -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,