Module: check_mk
Branch: master
Commit: b7e55fc8dcf00b42a612429449411354a711d3a4
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b7e55fc8dcf00b…
Author: Marcel Schulte <ms(a)mathias-kettner.de>
Date: Sat Nov 26 00:25:01 2016 +0100
3942 FIX rstcli: fixed previously failing check, changed check output to provide more
information
The check failed with "unsupported item name". This has been fixed now.
Additionally, check output has been changed to provide more information.
---
.werks/3942 | 11 +++++++++++
ChangeLog | 1 +
checks/rstcli | 8 +++++---
3 files changed, 17 insertions(+), 3 deletions(-)
diff --git a/.werks/3942 b/.werks/3942
new file mode 100644
index 0000000..3350a80
--- /dev/null
+++ b/.werks/3942
@@ -0,0 +1,11 @@
+Title: rstcli: fixed previously failing check, changed check output to provide more
information
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.4.0i3
+Date: 1480115995
+Class: fix
+
+The check failed with "unsupported item name". This has been fixed now.
+
+Additionally, check output has been changed to provide more information.
diff --git a/ChangeLog b/ChangeLog
index 9373d7c..c0620ea 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -28,6 +28,7 @@
* 4069 FIX: cmciii.phase: Fixed broken check with some devices...
* 4092 FIX: if.include: fixed wrong calculated number of interfaces which are up in
case of interface groups
* 4093 FIX: oracle_tablespaces: Werk 3907 broke the space calculation...
+ * 3942 FIX: rstcli: fixed previously failing check, changed check output to provide
more information...
Multisite:
* 4070 Added a painter for the service check period
diff --git a/checks/rstcli b/checks/rstcli
index 4ea3736..25694a5 100644
--- a/checks/rstcli
+++ b/checks/rstcli
@@ -157,7 +157,7 @@ def inventory_rstcli_pdisks(parsed):
def check_rstcli_pdisks(item, params, parsed):
reg = regex("(.*)/([0-9\-]*)")
match = reg.match(item)
- if match:
+ if not match:
return 3, "unsupported item name"
volume, disk_id = match.group(1), match.group(2)
@@ -165,8 +165,10 @@ def check_rstcli_pdisks(item, params, parsed):
disks = parsed.get(volume, {}).get('Disks', [])
for disk in disks:
if disk['ID'] == disk_id:
- return rstcli_states.get(disk['State'], 2), \
- "[%s] state %s" % (disk['Serial Number'],
disk['State'])
+ infotext = "%s (unit: %s, size: %s, type: %s, model: %s, serial:
%s)" % \
+ (disk['State'], volume, disk['Size'],
disk['Disk Type'],
+ disk['Model'], disk['Serial Number'])
+ return rstcli_states.get(disk['State'], 2), infotext
check_info["rstcli.pdisks"] = {