Module: check_mk
Branch: master
Commit: 24dff20021798db64776d0803b3c541a1b02d22d
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=24dff20021798d…
Author: Konstantin Büttner <kb(a)mathias-kettner.de>
Date: Fri Jan 27 17:29:44 2017 +0100
4215 hp_webmgmt_status: Now also displays device model and serial number
Change-Id: Id0b3599beeaa1f7017eb015e93d2fb03a88af47f
---
.werks/4215 | 9 +++++++++
ChangeLog | 1 +
checks/hp_webmgmt_status | 16 +++++++++++++---
3 files changed, 23 insertions(+), 3 deletions(-)
diff --git a/.werks/4215 b/.werks/4215
new file mode 100644
index 0000000..1d792fc
--- /dev/null
+++ b/.werks/4215
@@ -0,0 +1,9 @@
+Title: hp_webmgmt_status: Now also displays device model and serial number
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.4.0i4
+Date: 1485534564
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index fc04b6c..4fba649 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -18,6 +18,7 @@
* 4013 Ruckus Spot / ruckus_spot_locations: new check to monitor the number of unqiue
MACs addresses...
* 4293 wut_webtherm: now detects devices which support WebGraphThermoBaro-MIB
* 4296 mssql_databases: new check which monitors the auto close and shrink state of
MSSQL databases...
+ * 4215 hp_webmgmt_status: Now also displays device model and serial number
* 4171 FIX: perle_psmu: fixed value error...
* 4172 FIX: smart.temp: fixed discovery and check function...
* 4173 FIX: if.include: ignore some more keys in 'Network interfaces and switch
ports' rule which are only used for interface grouping
diff --git a/checks/hp_webmgmt_status b/checks/hp_webmgmt_status
index 8f4a8fb..97c073a 100644
--- a/checks/hp_webmgmt_status
+++ b/checks/hp_webmgmt_status
@@ -39,10 +39,16 @@ def check_hp_webmgmt_status(item, _no_params, info):
"5": (2, "critical"),
"6": (2, "non-recoverable")
}
- for index, health in info:
+
+ device_model = info[1][0][0]
+ serial_number = info[2][0][0]
+ for index, health in info[0]:
if index == item:
status, status_msg = status_map[health]
- return status, "Device status: %s" % status_msg
+ infotext = "Device status: %s" % status_msg
+ if device_model and serial_number:
+ infotext += " [Model: %s, Serial Number: %s]" % (device_model,
serial_number)
+ return status, infotext
check_info['hp_webmgmt_status'] = {
@@ -51,8 +57,12 @@ check_info['hp_webmgmt_status'] = {
'service_description' : "Status %s",
'snmp_scan_function' : lambda oid:
oid(".1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.4.1.11")\
and
oid(".1.3.6.1.4.1.11.2.36.1.1.5.1.1.*"),
- 'snmp_info' : ('.1.3.6.1.4.1.11.2.36.1.1.5.1.1', [1, #
hpHttpMgDeviceIndex
+ 'snmp_info' : [
+ ('.1.3.6.1.4.1.11.2.36.1.1.5.1.1', [1, #
hpHttpMgDeviceIndex
3 #
hpHttpMgDeviceHealth
]),
+ ('.1.3.6.1.4.1.11.2.36.1.1.5.1.1.9', [1]), #
Device Model
+ ('.1.3.6.1.4.1.11.2.36.1.1.5.1.1.10', [1]), #
Device Serial Number
+ ]
}