Module: check_mk
Branch: master
Commit: a3b5a627ae65ce44bd6cac5d8d0a62ad83e3d645
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a3b5a627ae65ce…
Author: Goetz Golla <gg(a)mathias-kettner.de>
Date: Thu Feb 26 16:41:06 2015 +0100
#1863 FIX cisco_power: fix for cases with a slash in the device description of a power
supply
Power Supplies with a slash in the device description were added in service discovery,
but could not be found when carrying out the check. This problem has been fixed.
In addition, when you have power supplies which have a service description
containing the ID of the power supply at the end like "<power supply
name>/<ID>", i.e. with a SLASH, you have to redo the service discovery
and the service description will then contain the ID added with a blank
instead, i.e. "<power supply name> <ID>". This is a rare case only
relevant
for versions of cisco_power younger than 2015/01/30, and only if you have
non-unique power supply names with trailing digits in the name.
---
.werks/1863 | 18 ++++++++++++++++++
ChangeLog | 2 ++
checks/cisco_power | 6 ++----
3 files changed, 22 insertions(+), 4 deletions(-)
diff --git a/.werks/1863 b/.werks/1863
new file mode 100644
index 0000000..1c82d18
--- /dev/null
+++ b/.werks/1863
@@ -0,0 +1,18 @@
+Title: cisco_power: fix for cases with a slash in the device description of a power
supply
+Level: 1
+Component: checks
+Compatible: incomp
+Version: 1.2.7i1
+Date: 1424964446
+Class: fix
+
+Power Supplies with a slash in the device description were added in service discovery,
+but could not be found when carrying out the check. This problem has been fixed.
+
+In addition, when you have power supplies which have a service description
+containing the ID of the power supply at the end like "<power supply
+name>/<ID>", i.e. with a SLASH, you have to redo the service discovery
+and the service description will then contain the ID added with a blank
+instead, i.e. "<power supply name> <ID>". This is a rare case only
relevant
+for versions of cisco_power younger than 2015/01/30, and only if you have
+non-unique power supply names with trailing digits in the name.
diff --git a/ChangeLog b/ChangeLog
index fd7f335..164f360 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -203,6 +203,8 @@
* 2021 FIX: if_lancom: Also used for checking ELSA/T-Systems branded devices
* 2022 FIX: SNMP: Fixed handling of backslashes in SNMP data...
NOTE: Please refer to the migration notes!
+ * 1863 FIX: cisco_power: fix for cases with a slash in the device description of a
power supply...
+ NOTE: Please refer to the migration notes!
Multisite:
* 1758 Improved exception hander: Shows details without additional debug request,
added mailto link for error report...
diff --git a/checks/cisco_power b/checks/cisco_power
index 8d67efc..7dc3e81 100644
--- a/checks/cisco_power
+++ b/checks/cisco_power
@@ -65,14 +65,12 @@ def inventory_cisco_power(info):
yield name, None
else:
for entry in entries:
- yield ("%s/%s" % (name, entry)), None
+ yield ("%s %s" % (name, entry)), None
def check_cisco_power(item, no_params, info):
- if "/" in item:
- item = item.split("/")[1]
for sid, textinfo, state, source in info:
- if sid == item or cisco_sensor_item(textinfo, sid) == item:
+ if cisco_sensor_item(textinfo, sid) == item or cisco_sensor_item(textinfo,
sid)+" "+sid == item:
state = int(state)
source = int(source)
output = 'state: %s, source: %s' % \