[checkmk-commits] Check_MK Git: check_mk: #1224 FIX Fixed rare Bug in case of clusterd network interfaces

Bastian Kuhn bk at mathias-kettner.de
Fri Feb 27 13:58:37 CET 2015


Module: check_mk
Branch: master
Commit: 4fe7d6e6e8dfa4a0a159125a4ea389367ca37a95
URL:    http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4fe7d6e6e8dfa4a0a159125a4ea389367ca37a95

Author: Bastian Kuhn <bk at mathias-kettner.de>
Date:   Fri Feb 27 13:56:55 2015 +0100

#1224 FIX Fixed rare Bug in case of clusterd network interfaces

In case that all network interfaces don't have traffic for a moment (or counter wraps), Check_MK was unable to determine the active one.
The only solution is to use a random one here.

---

 .werks/1224       |   11 +++++++++++
 ChangeLog         |    1 +
 checks/if.include |    5 +++++
 3 files changed, 17 insertions(+)

diff --git a/.werks/1224 b/.werks/1224
new file mode 100644
index 0000000..1e9709c
--- /dev/null
+++ b/.werks/1224
@@ -0,0 +1,11 @@
+Title: Fixed rare Bug in case of clusterd network interfaces
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i1
+Date: 1425041662
+
+In case that all network interfaces don't have traffic for a moment (or counter wraps), Check_MK was unable to determine the active one.
+The only solution is to use a random one here. 
diff --git a/ChangeLog b/ChangeLog
index fd7f335..4987668 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -203,6 +203,7 @@
     * 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!
+    * 1224 FIX: Fixed rare Bug in case of clusterd network interfaces...
 
     Multisite:
     * 1758 Improved exception hander: Shows details without additional debug request, added mailto link for error report...
diff --git a/checks/if.include b/checks/if.include
index d484ef9..a972cd5 100644
--- a/checks/if.include
+++ b/checks/if.include
@@ -697,6 +697,7 @@ def check_if_common_single(item, params, info, force_counter_wrap = False, has_n
     # which is master
     if cluster_items:
         maxval = 0
+        choosen_node = None
         for node, result in cluster_items.items():
             state, infotext, perfdata = result
             for entry in perfdata:
@@ -705,6 +706,10 @@ def check_if_common_single(item, params, info, force_counter_wrap = False, has_n
                     maxval = max(maxval, value)
                     if maxval == value:
                         choosen_node = node
+        # In case that each node has a counter wrap for
+        # out, we use the last note from the list as source
+        if not choosen_node:
+            choosen_node = node
         return cluster_items[choosen_node]
 
     return (3, "no such interface")



More information about the checkmk-commits mailing list