Module: check_mk
Branch: master
Commit: 35854cdb60e80eb12f4667c575e938e602910471
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=35854cdb60e80e…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Fri Feb 22 14:02:55 2013 +0100
cisco_qos: different method to determine qos bandwidth
---
checks/cisco_qos | 15 +++++++++++----
1 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/checks/cisco_qos b/checks/cisco_qos
index 73c78c9..80e0688 100644
--- a/checks/cisco_qos
+++ b/checks/cisco_qos
@@ -182,10 +182,17 @@ def check_cisco_qos(item, params, info):
drop_b = drop_bytes[policy_if_id+'.'+policy_if_id2]
speed = saveint(if_speeds[if_id])
- for key, value in parents.items():
- if value == policy_if_id2:
- if parents_type[key] == "4":
- speed = saveint(if_qos_bandwidth[config[key]]) * 1000
+ speed_found = False
+ for a_key, a_value in config.items():
+ if speed_found:
+ break
+ if a_value == class_id:
+ parent_value = a_key.split(".")[1]
+ for b_key, b_value in parents.items():
+ if parent_value == b_value:
+ if parents_type[b_key] == "4":
+ speed = saveint(if_qos_bandwidth[config[b_key]]) * 1000
+ speed_found = True
# Bandwidth needs to be in bytes for later calculations
bw = speed / 8.0