Module: check_mk
Branch: master
Commit: b288ad45d5a64fa3f21777717e624b3cc1a86c71
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b288ad45d5a64f…
Author: Goetz Golla <gg(a)mathias-kettner.de>
Date: Fri Jan 9 15:20:24 2015 +0100
netscaler_ha: modified the way state is calculated
---
checkman/netscaler_ha | 6 +++---
checks/netscaler_ha | 17 ++++-------------
2 files changed, 7 insertions(+), 16 deletions(-)
diff --git a/checkman/netscaler_ha b/checkman/netscaler_ha
index f07a9d0..e973319 100644
--- a/checkman/netscaler_ha
+++ b/checkman/netscaler_ha
@@ -12,9 +12,9 @@ description:
The check is in the state OK when the system is not setup for ha, or
{haCurState} is up/funtional. It is in the state WARN when the system is
manually configured not to participate in a HA cluster, or initializing to
- become a cluster member, or when {haCurState} is {monitorFAIL} or {monitorOK},
- because these two states are not documented in the MIB. It is critical in
- other states {haCurState} can be.
+ become a cluster member, or when {haCurState} is {monitorFAIL}, {monitorOK},
+ or {unkown} because these states are not documented in the MIB. It is
+ critical in other states {haCurState} can be.
inventory:
One service per host will be created.
diff --git a/checks/netscaler_ha b/checks/netscaler_ha
index 927cba4..dfb47fe 100644
--- a/checks/netscaler_ha
+++ b/checks/netscaler_ha
@@ -30,7 +30,7 @@
# .1.3.6.1.4.1.5951.4.1.1.23.24.0 3
netscaler_ha_cur_states = {
- 0: ("unknown", 3),
+ 0: ("unknown", 1),
1: ("initializing", 1), # Indicates that the node is in the process of
becoming part of the high
# availability configuration.
2: ("down", 2), # undocumented
@@ -75,19 +75,10 @@ def check_netscaler_ha(_no_item, _no_params, info):
if cur_status == 0:
infotext = "System not setup for HA"
else:
- infotext = "Mode: %s, State: %s" % (
netscaler_ha_peer_mode.get(peer_state)[0],
-
netscaler_ha_cur_states.get(cur_state)[0],
+ infotext = "Mode: %s, State: %s" % (
netscaler_ha_peer_mode[peer_state][0],
+ netscaler_ha_cur_states[cur_state][0],
)
- # severity: 2, 1, 3, 0, the worst one wins
- if netscaler_ha_cur_states.get(cur_state)[1] == 2 or \
- netscaler_ha_cur_states.get(cur_state)[1] == 2:
- state = 2
- elif netscaler_ha_cur_states.get(cur_state)[1] == 1 or \
- netscaler_ha_cur_states.get(cur_state)[1] == 1:
- state = 1
- elif netscaler_ha_cur_states.get(cur_state)[1] == 3 or \
- netscaler_ha_cur_states.get(cur_state)[1] == 3:
- state = 3
+ state = max(netscaler_ha_cur_states[cur_state][1],
netscaler_ha_peer_mode[peer_state)[1])
return state, infotext