[checkmk-commits] Check_MK Git: check_mk: better way to identified down or disabled nodes

Goetz Golla gg at mathias-kettner.de
Thu Aug 28 15:40:25 CEST 2014


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

Author: Goetz Golla <gg at mathias-kettner.de>
Date:   Thu Aug 28 15:39:27 2014 +0200

better way to identified down or disabled nodes

---

 checkman/f5_bigip_pool |   13 ++++++-------
 checks/f5_bigip_pool   |   16 +++++++++-------
 2 files changed, 15 insertions(+), 14 deletions(-)

diff --git a/checkman/f5_bigip_pool b/checkman/f5_bigip_pool
index d20cea3..0a95867 100644
--- a/checkman/f5_bigip_pool
+++ b/checkman/f5_bigip_pool
@@ -13,8 +13,10 @@ description:
  It supports devices running the 9.0 and above releases of the F5 OS. It's
  tested against 9.3 devices.
 
- If there are down nodes, the names of the nodes are also printed in the
- service output.
+ If there are down or disabled nodes, the names of the nodes are
+ also printed in the service output. They are identified using the
+ following oids: ltmPoolMemberMonitorState, ltmPoolMemberMonitorStatus,
+ ltmPoolMemberSessionStatus
 
 examples:
  # Let the Pool named ABC on your first F5 be in WARNING state when it reaches 5 active members or in CRITICAL for anything between 3 and 0.
@@ -28,12 +30,9 @@ inventory:
  non-enabled ones, as this is considered a temporary state.
 
 [parameters]
-warning (int): issue a warning if there are less than warn members left in
-a load balancing pool
+warning (int): issue a warning if there are less than warn members left in a load balancing pool
 
-crit (int): go to critical state if there are less than crit members left
-in a load balancing pool. Note: 0 active members will always result in a
-critical state.
+crit (int): go to critical state if there are less than crit members left in a load balancing pool. Note: 0 active members will always result in a critical state.
 
 [configuration]
 f5_bigip_pool_default_levels = (int, int): The default levels for all F5 BIG-IP pool checks. This is preset to {(2, 1)}.
diff --git a/checks/f5_bigip_pool b/checks/f5_bigip_pool
index 9a4367a..be35327 100644
--- a/checks/f5_bigip_pool
+++ b/checks/f5_bigip_pool
@@ -46,14 +46,14 @@ def inventory_f5_bigip_pool(checkname,info):
 
 def f5_bigip_pool_get_down_members(info, item):
     downs = []
-    if len(info) < 2:
+    if len(info) < 2: # no data for pool members
         return
     for line in info[1]:
-        if line[0] == item and line[2] != '4':
-            if re.match("\/\S*\/\S*", line[3]):
-                host = line[3].split("/")[2]
+        if line[0] == item and (line[2] != '4' or line[3] != '4' or line[4] in ('2', '3', '4', '5' )):
+            if re.match("\/\S*\/\S*", line[5]):
+                host = line[5].split("/")[2]
             else:
-                host = line[3]
+                host = line[5]
             downs.append(host+":"+line[1])
     return downs
 
@@ -76,7 +76,7 @@ def check_f5_bigip_pool(item, params, info):
 
             if pool_act_members < pool_def_members:
                 downs = f5_bigip_pool_get_down_members(info, item)
-                message += ", down nodes: %s" % ", ".join(downs)
+                message += ", down/disabled nodes: %s" % ", ".join(downs)
 
             return state, message
     return 3, "unexpected Output from SNMP Agent"
@@ -95,7 +95,9 @@ check_info["f5_bigip_pool"] = {
             ('.1.3.6.1.4.1.3375.2.2.5.3.2.1', [
                     1, # ltmPoolMemberPoolName
                     4, # ltmPoolMemberPort
-                    10, # ltmPoolMemberState
+                    10, # ltmPoolMemberMonitorState
+                    11, # ltmPoolMemberMonitorStatus
+                    13, # ltmPoolMemberSessionStatus
                     19, # ltmPoolMemberNodeName
                 ]),
         ],



More information about the checkmk-commits mailing list