Module: check_mk
Branch: master
Commit: 0083522aba86ef8ec355a5585194e8e41c210a0e
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=0083522aba86ef…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Wed Dec 3 19:00:30 2014 +0100
#1617 FIX lnx_if: Deal with data provided by cluster host
---
.werks/1617 | 9 +++++++++
ChangeLog | 1 +
checks/lnx_if | 7 ++++++-
3 files changed, 16 insertions(+), 1 deletion(-)
diff --git a/.werks/1617 b/.werks/1617
new file mode 100644
index 0000000..724d0c3
--- /dev/null
+++ b/.werks/1617
@@ -0,0 +1,9 @@
+Title: lnx_if: Deal with data provided by cluster host
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.5i7
+Date: 1417629588
+Class: fix
+
+
diff --git a/ChangeLog b/ChangeLog
index ca48adb..a93428a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -75,6 +75,7 @@
* 1609 FIX: zpool_status: fix problem when the zpool has a separate log or cache
device...
* 1566 FIX: 3ware_disks: consider VERIFYING state as OK now...
* 1612 FIX: job: Fixed wrong reported start time for running jobs
+ * 1617 FIX: lnx_if: Deal with data provided by cluster host
Multisite:
* 1508 Allow input of plugin output and perfdata when faking check results...
diff --git a/checks/lnx_if b/checks/lnx_if
index 1e36aff..15e2e93 100644
--- a/checks/lnx_if
+++ b/checks/lnx_if
@@ -53,14 +53,19 @@ def if_lnx_convert_to_if64(info):
current_nic = None
index = 0
for line in info:
+ # Be careful! On clustered hosts we have more than one perf-counters section
+ # and ethtool section. This needs to be handled. Sadly we have no section
+ # headers. Try to detect it by data format.
if line[0].startswith('['):
current_nic = line[0][1:-1]
index += 1
nic_info[current_nic]['index'] = index
- elif current_nic == None: # still in perf-counters subsection
+ elif len(line) == 2 and len(line[1].split()) >= 16:
+ # This looks like a perf-counter line
nic = line[0]
nic_info[nic] = { "counters": map(int, line[1].split()) }
else:
+ # ethtool data line
nic_info[current_nic][line[0].strip()] =
":".join(line[1:]).strip()
# if index is 0 we either have found no nics or no information