Module: check_mk
Branch: master
Commit: 5388f0edd2baa257c9b0987936fa3b0536cdeab8
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5388f0edd2baa2…
Author: Florian Heigl <fh(a)mathias-kettner.de>
Date: Fri Jun 3 11:25:48 2011 +0200
new option f5_bigip_pool_default_levels allows to configure the warning and crit levels of
active pool members per load balancing pool.
---
checkman/f5_bigip_pool | 16 ++++++++++++++++
checks/f5_bigip_pool | 20 +++++++++++++-------
2 files changed, 29 insertions(+), 7 deletions(-)
diff --git a/checkman/f5_bigip_pool b/checkman/f5_bigip_pool
index b7a2032..ff847af 100644
--- a/checkman/f5_bigip_pool
+++ b/checkman/f5_bigip_pool
@@ -12,9 +12,25 @@ description:
It supports devices running the 9.0 and above releases of the F5 OS. It's tested
against 9.3
devices.
+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.
+ check_parameters += [
+ ( (5, 3), [ "f5-1" ], [ "Load Balancing Pool Pool_ABC" ]),
+ ]
+
+
inventory:
The check gather a list of the pools defined on a system. It will include non-enabled
ones,
as this is considered a temporary state.
+[parameters]
+warning (int): Issue a warning if there's this many or less members left in a load
balancing pool
+crit (int): Go to critical state if there's this many 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)}.
+
+
+
perfdata:
the check does not (yet) generate performance data.
diff --git a/checks/f5_bigip_pool b/checks/f5_bigip_pool
index 69086bc..7126b91 100644
--- a/checks/f5_bigip_pool
+++ b/checks/f5_bigip_pool
@@ -32,28 +32,34 @@
# F5-BIGIP-LOCAL-MIB::ltmPoolActiveMemberCnt. 8.80.111.111.108.95.78.77.65 = 0
+# warn, crit numbers of pool members
+f5_bigip_pool_default_levels = (2, 1)
+
+
def inventory_f5_bigip_pool(checkname,info):
# inventorize all pools and their member count
inventory = []
for line in info:
if line[0] != "":
- inventory.append((line[0],None))
+ inventory.append((line[0],"f5_bigip_pool_default_levels"))
return inventory
-def check_f5_bigip_pool(item, _no_params, info):
+def check_f5_bigip_pool(item, params, info):
for line in info:
if line[0] == item:
+ warn_num_members, crit_num_members = params
pool_act_members = int(line[1])
pool_def_members = int(line[2])
- if pool_act_members == pool_def_members:
+
+ if pool_act_members == pool_def_members or pool_act_members >
warn_num_members:
return (0, "OK - all members online")
- elif pool_act_members > 1:
- return (1, "WARN - only %i of %i pool members are up" %
(pool_act_members, pool_def_members))
- elif pool_act_members == 1:
- return (2, "CRIT - only 1 pool member left")
+ elif pool_act_members <= crit_num_members:
+ return (2, "CRIT - only %s pool member(s) left" % pool_act_members)
elif pool_act_members == 0:
return (2, "CRIT - no pool members left")
+ elif pool_act_members <= warn_num_members:
+ return (1, "WARN - only %i of %i pool members are up" %
(pool_act_members, pool_def_members))
else:
return (3, "UNKNOWN output for pool %s" % item)
return (3, "UNKNOWN - unexpected Output from SNMP Agent")