lausser / check_ups_health

A plugin (monitoring-plugin, not nagios-plugin, see also http://is.gd/PP1330) for uninterruptible power supplies.
GNU General Public License v2.0
7 stars 7 forks source link

do not add upsEstimatedMinutesRemaining to perfdata if is an empty st… #17

Open honzatlusty opened 3 years ago

honzatlusty commented 3 years ago

Enconnex AC6000 seems to return NULL for upsEstimatedMinutesRemaining when the battery is not used.

[honza@archlinux }$ snmpwalk  -v 2c -c public $device  1.3.6.1.2.1.33.1.2.3.0
SNMPv2-SMI::mib-2.33.1.2.3.0 = NULL

Which causes this behavior

[honza@archlinux ]$ perl ./check_ups_health --hostname $device --mode battery-health  --community public -t 3600  
Use of uninitialized value $value in sprintf at check_ups_health line 585.
OK - temperature is 28.00C, unit is not on battery power, capacity is 95.00%, output load0 0.00% | 'battery_temperature'=28;35;38;; 'remaining_time'=;0:;0:;; 'capacity'=95%;25:;10:;0;100 'battery_voltage'=19.80;;;; 'output_frequency'=60;;;; 'input_voltage0'=202;;;; 'input_frequency0'=60;;;; 'output_load0'=0%;75;85;0;100 'output_voltage0'=200;;;; 'output_current0'=8.30;;;; 'output_power0'=1624;;;;

Signed-off-by: Jan Tlusty j.tlusty@gmail.com