Module: check_mk
Branch: master
Commit: aa9bffa1c87114f94328a09699eeec11471878c1
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=aa9bffa1c87114…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Sat Apr 9 13:55:13 2016 +0200
updated werk and added plugged-in state
---
.werks/3311 | 2 +-
ChangeLog | 2 +-
checks/apc_netbotz_sensors | 101 ++++++++++++++++++++++++++++++++------------
3 files changed, 77 insertions(+), 28 deletions(-)
diff --git a/.werks/3311 b/.werks/3311
index 2cf7701..0ffc051 100644
--- a/.werks/3311
+++ b/.werks/3311
@@ -1,4 +1,4 @@
-Title: apc_netbotz_sensors, apc_netbotz_sensors.dewpoint, apc_netbotz_sensors.humidity:
new checks for APC Netbotz devices which support the NETBOTZV2 MIB
+Title: apc_netbotz_sensors, apc_netbotz_sensors.dewpoint, apc_netbotz_sensors.humidity,
apc_netbotz_other_sensors: new checks for APC Netbotz devices which support the NETBOTZV2
MIB
Level: 1
Component: checks
Compatible: compat
diff --git a/ChangeLog b/ChangeLog
index d323a18..54fd501 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -45,7 +45,7 @@
* 3108 network interface and switch port discovery rules can now be combined to
dicover multiple sets of interfaces...
NOTE: Please refer to the migration notes!
* 3109 dotnet_clrmemory: levels are now configurable
- * 3311 apc_netbotz_sensors, apc_netbotz_sensors.dewpoint,
apc_netbotz_sensors.humidity: new checks for APC Netbotz devices which support the
NETBOTZV2 MIB
+ * 3311 apc_netbotz_sensors, apc_netbotz_sensors.dewpoint,
apc_netbotz_sensors.humidity, apc_netbotz_other_sensors: new checks for APC Netbotz
devices which support the NETBOTZV2 MIB
* 3115 logwatch: made check cluster-able...
* 3312 check_ssh: service description can be set
* 3073 FIX: windows agent: relative paths to mrpe scripts are now treated as relative
to the agent installation directory...
diff --git a/checks/apc_netbotz_sensors b/checks/apc_netbotz_sensors
index 228889a..8f9cbbf 100644
--- a/checks/apc_netbotz_sensors
+++ b/checks/apc_netbotz_sensors
@@ -26,33 +26,79 @@
# .1.3.6.1.4.1.5528.100.4.1.1.1.1.636159851 nbAlinkEnc_0_4_TEMP
+# .1.3.6.1.4.1.5528.100.4.1.1.1.1.882181375 nbAlinkEnc_2_1_TEMP
# .1.3.6.1.4.1.5528.100.4.1.1.1.1.1619732064 nbAlinkEnc_0_2_TEMP
+# .1.3.6.1.4.1.5528.100.4.1.1.1.1.1665932156 nbAlinkEnc_1_4_TEMP
+# .1.3.6.1.4.1.5528.100.4.1.1.1.1.1751899818 nbAlinkEnc_2_2_TEMP
+# .1.3.6.1.4.1.5528.100.4.1.1.1.1.1857547767 nbAlinkEnc_1_5_TEMP
+# .1.3.6.1.4.1.5528.100.4.1.1.1.1.2370211927 nbAlinkEnc_1_6_TEMP
+# .1.3.6.1.4.1.5528.100.4.1.1.1.1.2618588815 nbAlinkEnc_2_3_TEMP
# .1.3.6.1.4.1.5528.100.4.1.1.1.1.2628357572 nbAlinkEnc_0_1_TEMP
# .1.3.6.1.4.1.5528.100.4.1.1.1.1.3031356659 nbAlinkEnc_0_5_TEMP
# .1.3.6.1.4.1.5528.100.4.1.1.1.1.3056253200 nbAlinkEnc_0_6_TEMP
+# .1.3.6.1.4.1.5528.100.4.1.1.1.1.3103062985 nbAlinkEnc_2_4_TEMP
+# .1.3.6.1.4.1.5528.100.4.1.1.1.1.3328914949 nbAlinkEnc_1_3_TEMP
# .1.3.6.1.4.1.5528.100.4.1.1.1.1.3406802758 nbAlinkEnc_0_3_TEMP
-# .1.3.6.1.4.1.5528.100.4.1.1.1.2.636159851 238
-# .1.3.6.1.4.1.5528.100.4.1.1.1.2.1619732064 202
-# .1.3.6.1.4.1.5528.100.4.1.1.1.2.2628357572 225
-# .1.3.6.1.4.1.5528.100.4.1.1.1.2.3031356659 204
-# .1.3.6.1.4.1.5528.100.4.1.1.1.2.3056253200 239
-# .1.3.6.1.4.1.5528.100.4.1.1.1.2.3406802758 214
-# .1.3.6.1.4.1.5528.100.4.1.2.1.1.1744856019 nbAlinkEnc_0_4_HUMI
-# .1.3.6.1.4.1.5528.100.4.1.2.1.1.1974269701 nbAlinkEnc_0_2_HUMI
-# .1.3.6.1.4.1.5528.100.4.1.2.1.1.2804425567 nbAlinkEnc_0_1_HUMI
+# .1.3.6.1.4.1.5528.100.4.1.1.1.2.636159851 252
+# .1.3.6.1.4.1.5528.100.4.1.1.1.2.882181375 222
+# .1.3.6.1.4.1.5528.100.4.1.1.1.2.1619732064 222
+# .1.3.6.1.4.1.5528.100.4.1.1.1.2.1665932156 216
+# .1.3.6.1.4.1.5528.100.4.1.1.1.2.1751899818 245
+# .1.3.6.1.4.1.5528.100.4.1.1.1.2.1857547767 234
+# .1.3.6.1.4.1.5528.100.4.1.1.1.2.2370211927 240
+# .1.3.6.1.4.1.5528.100.4.1.1.1.2.2618588815 220
+# .1.3.6.1.4.1.5528.100.4.1.1.1.2.2628357572 229
+# .1.3.6.1.4.1.5528.100.4.1.1.1.2.3031356659 0
+# .1.3.6.1.4.1.5528.100.4.1.1.1.2.3056253200 0
+# .1.3.6.1.4.1.5528.100.4.1.1.1.2.3103062985 215
+# .1.3.6.1.4.1.5528.100.4.1.1.1.2.3328914949 234
+# .1.3.6.1.4.1.5528.100.4.1.1.1.2.3406802758 238
+# .1.3.6.1.4.1.5528.100.4.1.1.1.7.636159851 25.200000
+# .1.3.6.1.4.1.5528.100.4.1.1.1.7.882181375 22.200000
+# .1.3.6.1.4.1.5528.100.4.1.1.1.7.1619732064 22.200000
+# .1.3.6.1.4.1.5528.100.4.1.1.1.7.1665932156 21.600000
+# .1.3.6.1.4.1.5528.100.4.1.1.1.7.1751899818 24.500000
+# .1.3.6.1.4.1.5528.100.4.1.1.1.7.1857547767 23.400000
+# .1.3.6.1.4.1.5528.100.4.1.1.1.7.2370211927 24.000000
+# .1.3.6.1.4.1.5528.100.4.1.1.1.7.2618588815 22.000000
+# .1.3.6.1.4.1.5528.100.4.1.1.1.7.2628357572 22.900000
+# .1.3.6.1.4.1.5528.100.4.1.1.1.7.3031356659
+# .1.3.6.1.4.1.5528.100.4.1.1.1.7.3056253200
+# .1.3.6.1.4.1.5528.100.4.1.1.1.7.3103062985 21.500000
+# .1.3.6.1.4.1.5528.100.4.1.1.1.7.3328914949 23.400000
+# .1.3.6.1.4.1.5528.100.4.1.1.1.7.3406802758 23.800000
+
+# .1.3.6.1.4.1.5528.100.4.1.2.1.1.421607638 nbAlinkEnc_1_5_HUMI
+# .1.3.6.1.4.1.5528.100.4.1.2.1.1.581338442 nbAlinkEnc_1_3_HUMI
+# .1.3.6.1.4.1.5528.100.4.1.2.1.1.1121716336 nbAlinkEnc_0_6_HUMI
+# .1.3.6.1.4.1.5528.100.4.1.2.1.1.3273299739 nbAlinkEnc_0_3_HUMI
# .1.3.6.1.4.1.5528.100.4.1.2.1.1.4181308384 nbAlinkEnc_0_5_HUMI
-# .1.3.6.1.4.1.5528.100.4.1.2.1.2.1744856019 200
-# .1.3.6.1.4.1.5528.100.4.1.2.1.2.1974269701 360
-# .1.3.6.1.4.1.5528.100.4.1.2.1.2.2804425567 200
-# .1.3.6.1.4.1.5528.100.4.1.2.1.2.4181308384 370
+# .1.3.6.1.4.1.5528.100.4.1.2.1.2.421607638 370
+# .1.3.6.1.4.1.5528.100.4.1.2.1.2.581338442 320
+# .1.3.6.1.4.1.5528.100.4.1.2.1.2.1121716336 0
+# .1.3.6.1.4.1.5528.100.4.1.2.1.2.3273299739 320
+# .1.3.6.1.4.1.5528.100.4.1.2.1.2.4181308384 0
+# .1.3.6.1.4.1.5528.100.4.1.2.1.7.421607638 37.000000
+# .1.3.6.1.4.1.5528.100.4.1.2.1.7.581338442 32.000000
+# .1.3.6.1.4.1.5528.100.4.1.2.1.7.1121716336
+# .1.3.6.1.4.1.5528.100.4.1.2.1.7.3273299739 32.000000
+# .1.3.6.1.4.1.5528.100.4.1.2.1.7.4181308384
+
# .1.3.6.1.4.1.5528.100.4.1.3.1.1.1000015730 nbAlinkEnc_0_5_DWPT
-# .1.3.6.1.4.1.5528.100.4.1.3.1.1.1807639405 nbAlinkEnc_0_1_DWPT
-# .1.3.6.1.4.1.5528.100.4.1.3.1.1.2231143474 nbAlinkEnc_0_2_DWPT
-# .1.3.6.1.4.1.5528.100.4.1.3.1.1.4125059843 nbAlinkEnc_0_4_DWPT
-# .1.3.6.1.4.1.5528.100.4.1.3.1.2.1000015730 52
-# .1.3.6.1.4.1.5528.100.4.1.3.1.2.1807639405 -15
-# .1.3.6.1.4.1.5528.100.4.1.3.1.2.2231143474 46
-# .1.3.6.1.4.1.5528.100.4.1.3.1.2.4125059843 -5
+# .1.3.6.1.4.1.5528.100.4.1.3.1.1.1490079962 nbAlinkEnc_0_3_DWPT
+# .1.3.6.1.4.1.5528.100.4.1.3.1.1.2228353183 nbAlinkEnc_0_6_DWPT
+# .1.3.6.1.4.1.5528.100.4.1.3.1.1.2428087247 nbAlinkEnc_1_3_DWPT
+# .1.3.6.1.4.1.5528.100.4.1.3.1.1.3329736831 nbAlinkEnc_1_5_DWPT
+# .1.3.6.1.4.1.5528.100.4.1.3.1.2.1000015730 0
+# .1.3.6.1.4.1.5528.100.4.1.3.1.2.1490079962 61
+# .1.3.6.1.4.1.5528.100.4.1.3.1.2.2228353183 0
+# .1.3.6.1.4.1.5528.100.4.1.3.1.2.2428087247 57
+# .1.3.6.1.4.1.5528.100.4.1.3.1.2.3329736831 78
+# .1.3.6.1.4.1.5528.100.4.1.3.1.7.1000015730
+# .1.3.6.1.4.1.5528.100.4.1.3.1.7.1490079962 6.100000
+# .1.3.6.1.4.1.5528.100.4.1.3.1.7.2228353183
+# .1.3.6.1.4.1.5528.100.4.1.3.1.7.2428087247 5.700000
+# .1.3.6.1.4.1.5528.100.4.1.3.1.7.3329736831 7.800000
# .--temperature---------------------------------------------------------.
@@ -81,12 +127,13 @@ def parse_apc_netbotz_sensors(info):
"3" : "dewpoint",
}
parsed = {}
- for oid_item, reading_str in info:
- item_info = oid_item.split(".")
- item_type = map_sensors[item_info[0]]
- item_name = " ".join(item_info[2:])
- parsed.setdefault(item_type, {})
- parsed[item_type][item_name] = float(reading_str)/10
+ for oid_item, reading_str, plugged_in_state in info:
+ if plugged_in_state:
+ item_info = oid_item.split(".")
+ item_type = map_sensors[item_info[0]]
+ item_name = " ".join(item_info[2:])
+ parsed.setdefault(item_type, {})
+ parsed[item_type][item_name] = (float(reading_str)/10 )
return parsed
@@ -115,6 +162,8 @@ check_info['apc_netbotz_sensors'] = {
], [
"1", # NETBOTZV2-MIB::*SensorId
"2", # NETBOTZV2-MIB::*SensorValue
+ "7", # NETBOTZV2-MIB::*ValueStr
+ # empty if sensor is not plugged in
]),
'snmp_scan_function' : lambda oid: \
oid(".1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.4.1.5528.100.20.10.2014"),