Module: check_mk
Branch: master
Commit: a92acd82e50992f644c29a694568ea8c93693072
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a92acd82e50992…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Thu Dec 4 19:45:38 2014 +0100
#1679 FIX ups_bat_temp: Now skipping sensors which are reported to have 0
upsBatteryTemperature
---
.werks/1679 | 9 +++++++++
ChangeLog | 1 +
checks/ups_bat_temp | 9 +++++++--
3 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/.werks/1679 b/.werks/1679
new file mode 100644
index 0000000..ee50adf
--- /dev/null
+++ b/.werks/1679
@@ -0,0 +1,9 @@
+Title: ups_bat_temp: Now skipping sensors which are reported to have 0
upsBatteryTemperature
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.5i7
+Date: 1417718606
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index 0f607b3..d358f40 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -111,6 +111,7 @@
* 1655 FIX: AIX Agent: Fixed broken filesystem checks when having PowerHA
installed...
* 1656 FIX: cisco_vpn_tunnel: Refactored complete check, fixed threshold bugs...
* 1677 FIX: f5_bigip_interfaces: Cleaned up check a bit
+ * 1679 FIX: ups_bat_temp: Now skipping sensors which are reported to have 0
upsBatteryTemperature
Multisite:
* 1508 Allow input of plugin output and perfdata when faking check results...
diff --git a/checks/ups_bat_temp b/checks/ups_bat_temp
index dcc7827..5088152 100644
--- a/checks/ups_bat_temp
+++ b/checks/ups_bat_temp
@@ -28,7 +28,9 @@
ups_bat_temp_default = (40, 50) # warning / critical
def inventory_ups_bat_temp(info):
- if len(info) > 0:
+ # 2nd condition is needed to catch some UPS devices which do not have
+ # any temperature sensor but report a 0 as upsBatteryTemperature. Skip those lines
+ if len(info) > 0 and saveint(info[0][1]) != 0:
return [ ( x[0], "ups_bat_temp_default") for x in info ]
def check_ups_bat_temp(item, params, info):
@@ -45,7 +47,10 @@ check_info['ups_bat_temp'] = {
"service_description" : "Temperature Battery %s",
"has_perfdata" : True,
"group" : "hw_temperature",
- "snmp_info" : ( ".1.3.6.1.2.1.33.1", ["1.5",
"2.7" ] ),
+ "snmp_info" : ( ".1.3.6.1.2.1.33.1", [
+ "1.5", # upsIdentName
+ "2.7", # upsBatteryTemperature
+ ] ),
"snmp_scan_function" : lambda oid: oid(".1.3.6.1.2.1.1.2.0") in \
[ ".1.3.6.1.4.1.818.1.100.1.1",
".1.3.6.1.4.1.705.1.2", ".1.3.6.1.2.1.33",
".1.3.6.1.2.1.33.2", ".1.3.6.1.4.1.818.1.100.1.2" ] \
or
oid('.1.3.6.1.2.1.33.1.1.1.0').startswith('RPS'),