Module: check_mk
Branch: master
Commit: d055752e81f9733404ff8592e59514bb8858aee3
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d055752e81f973…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Thu Dec 12 17:36:48 2013 +0100
FIX cisco_qos: no longer crashes when the qos policy name is not set
When no policy name is set in the cisco device the policy id is used instead.
---
.werks/243 | 8 ++++++++
ChangeLog | 1 +
checks/cisco_qos | 7 +++++--
3 files changed, 14 insertions(+), 2 deletions(-)
diff --git a/.werks/243 b/.werks/243
new file mode 100644
index 0000000..013077a
--- /dev/null
+++ b/.werks/243
@@ -0,0 +1,8 @@
+Title: cisco_qos: no longer crashes when the qos policy name is not set
+Level: 1
+Component: checks
+Version: 1.2.3i8
+Date: 1386866017
+Class: fix
+
+When no policy name is set in the cisco device the policy map id is used instead.
diff --git a/ChangeLog b/ChangeLog
index 35790fa..6aeb966 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -18,6 +18,7 @@
* 0240 FIX: Virtualmachine names with space no longer have missing piggyback data...
* 0310 FIX: apache_status: Improved handling of unexpeted data sent by agents...
* 0088 FIX: esx_vsphere_datastores: fixed error with reported capacity of 0 bytes...
+ * 0243 FIX: cisco_qos: no longer crashes when the qos policy name is not set...
Multisite:
* 0302 FIX: Fixed highlight of choosen elements in foldertee/views snapin in
Chrome/IE
diff --git a/checks/cisco_qos b/checks/cisco_qos
index 7d2e092..c9b66e8 100644
--- a/checks/cisco_qos
+++ b/checks/cisco_qos
@@ -206,7 +206,7 @@ def check_cisco_qos(item, params, info):
if policy_map_id is None:
return 3, 'Invalid policy map id'
- policy_name = policies[policy_map_id]
+ policy_name = policies.get(policy_map_id)
policy_id = this_policy_id
objects_id = this_objects_id
@@ -314,7 +314,10 @@ def check_cisco_qos(item, params, info):
state = max(1, state)
infotext += '(!)'
- infotext += ', Policy-Name: %s, Int-Bandwidth: %s' % (policy_name,
format_value(bw))
+ if policy_name:
+ infotext += ', Policy-Name: %s, Int-Bandwidth: %s' % (policy_name,
format_value(bw))
+ else:
+ infotext += ', Policy-Map-ID: %s, Int-Bandwidth: %s' % (policy_map_id,
format_value(bw))
return (state, infotext.lstrip(', '), perfdata)
check_info["cisco_qos"] = {