Module: check_mk
Branch: master
Commit: 27cba19795627b81c6be6f93845056f224566bc2
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=27cba19795627b…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Tue Sep 25 13:35:35 2018 +0200
winperf_if: Improve unpacking info variable
Change-Id: Iac05c5e90432b563840c4af31553c7d964400a2c
---
checks/winperf_if | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/checks/winperf_if b/checks/winperf_if
index f2b869b..4f9d7d1 100644
--- a/checks/winperf_if
+++ b/checks/winperf_if
@@ -90,15 +90,20 @@ def winperf_if_normalize_nic_name(name, nic_names):
def parse_winperf_if(info):
- nic_names = map(winperf_if_canonize_nic_name, info[1][2:])
- nic_index = winperf_if_get_nic_index_map(nic_names)
+ try:
+ timestamp_info, names_info, data = info[0], info[1], info[2:]
+ except ValueError:
+ return []
try:
- agent_timestamp = float(info[0][0])
+ agent_timestamp = float(timestamp_info[0])
except (IndexError, ValueError):
agent_timestamp = None
- lines = iter(info)
+ nic_names = map(winperf_if_canonize_nic_name, names_info[2:])
+ nic_index = winperf_if_get_nic_index_map(nic_names)
+
+ lines = iter(data)
lines.next() # skip line with timestamp and counter number
lines.next() # skip interface line (already evaluated)
nics = dict([(n, {}) for n in nic_names])