Module: check_mk
Branch: master
Commit: 5aec7bef386538eb539fa93121c3f9e603556e19
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5aec7bef386538…
Author: Goetz Golla <gg(a)mathias-kettner.de>
Date: Fri Jan 9 10:47:35 2015 +0100
#1462 netscaler_ha: new check to monitor the HA state of Citrix Netscaler appliances
---
.werks/1462 | 9 +++++
ChangeLog | 1 +
checkman/netscaler_ha | 20 ++++++++++
checks/netscaler_ha | 104 +++++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 134 insertions(+)
diff --git a/.werks/1462 b/.werks/1462
new file mode 100644
index 0000000..09e4e99
--- /dev/null
+++ b/.werks/1462
@@ -0,0 +1,9 @@
+Title: netscaler_ha: new check to monitor the HA state of Citrix Netscaler appliances
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i1
+Date: 1420796806
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index 9ec4077..05a4063 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -24,6 +24,7 @@
* 1820 mem.linux: new dedicated check for Linux memory management...
NOTE: Please refer to the migration notes!
* 1831 diskstat: detect multipath devices and handle them instead of the physical
paths...
+ * 1462 netscaler_ha: new check to monitor the HA state of Citrix Netscaler
appliances
* 1457 FIX: logins: new check renamed from "users" check...
NOTE: Please refer to the migration notes!
* 1762 FIX: lnx_thermal: Now ignoring trip points with level 0...
diff --git a/checkman/netscaler_ha b/checkman/netscaler_ha
new file mode 100644
index 0000000..c9ea923
--- /dev/null
+++ b/checkman/netscaler_ha
@@ -0,0 +1,20 @@
+title: Citrix Netscaler CPU Utilization
+agents: snmp
+catalog: app/netscaler
+license: GPL
+distribution: check_mk
+description:
+ This check monitors the high availability status of Citrix Netscaler
+ Loadbalacing Appliances operating in a cluster setup. It uses snmp and the
+ NS-ROOT-MIB to access the {haPeerState}, {haCurStatus} and {haCurState}
+ OIDs from the nsHighAvailabilityGroup.
+
+ 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.
+
+inventory:
+ One service per host will be created.
diff --git a/checks/netscaler_ha b/checks/netscaler_ha
new file mode 100644
index 0000000..927cba4
--- /dev/null
+++ b/checks/netscaler_ha
@@ -0,0 +1,104 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2014 mk(a)mathias-kettner.de |
+# +------------------------------------------------------------------+
+#
+# This file is part of Check_MK.
+# The official homepage is at
http://mathias-kettner.de/check_mk.
+#
+# check_mk is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation in version 2. check_mk is distributed
+# in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-
+# out even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE. See the GNU General Public License for more de-
+# ails. You should have received a copy of the GNU General Public
+# License along with GNU Make; see the file COPYING. If not, write
+# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+# Boston, MA 02110-1301 USA.
+#
+# Example Output:
+# .1.3.6.1.4.1.5951.4.1.1.23.3.0 1
+# .1.3.6.1.4.1.5951.4.1.1.23.23.0 1
+# .1.3.6.1.4.1.5951.4.1.1.23.24.0 3
+
+netscaler_ha_cur_states = {
+ 0: ("unknown", 3),
+ 1: ("initializing", 1), # Indicates that the node is in the process of
becoming part of the high
+ # availability configuration.
+ 2: ("down", 2), # undocumented
+ 3: ("functional", 0), # Indicates that the node is accessible and can
function as either
+ # a primary or secondary node.
+ 4: ("some HA monitored interfaces failed", 2), # Indicates that one of the
high availability monitored
+ # interfaces has failed because of a
card or link failure.
+ # This state triggers a failover.
+ 5: ("monitorFail", 1), # undocumented
+ 6: ("monitorOK", 1), # undocumented
+ 7: ("all HA monitored interfaces failed", 2), # Indicates that all the
interfaces of the node are
+ # unusable because the interfaces on
which high
+ # availability monitoring is enabled
are not connected
+ # or are manually disabled. This state
triggers a failover.
+ 8: ("configured to listening mode (dumb)", 1), # Indicates that the node is
in listening mode. It does not
+ # participate in high availability
transitions or transfer
+ # configuration from the peer node.
This is a configured
+ # value, not a statistic.
+ 9: ("HA status manually disabled", 1), # Indicates that the high
availability status of the node has been
+ # manually disabled. Synchronization and
propagation cannot take
+ # place between the peer nodes.
+ 10: ("SSL card failed", 2), # Indicates that the SSL card has failed. This
state triggers a failover.
+ 11: ("route monitor has failed", 2), # Indicates that the route monitor has
failed. This state triggers
+ # a failover.
+}
+
+netscaler_ha_peer_mode = {
+ 0: ("standalone", 0),
+ 1: ("primary", 0),
+ 2: ("secomdary", 0),
+ 3: ("unknown", 1),
+}
+
+def inventory_netscaler_ha(info):
+ if info:
+ return [ (None, None) ]
+
+def check_netscaler_ha(_no_item, _no_params, info):
+ if info:
+ state = 0
+ peer_state, cur_status, cur_state = map(int, info[0])
+ 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],
+ )
+ # 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
+
+ return state, infotext
+
+check_info["netscaler_ha"] = {
+ "check_function" : check_netscaler_ha,
+ "inventory_function" : inventory_netscaler_ha,
+ "service_description" : "HA Node Status",
+ "snmp_info" : (".1.3.6.1.4.1.5951.4.1.1.23", [ #
nsHighAvailabilityGroup
+ 3, # haPeerState
+ 23, # haCurStatus
+ 24, # haCurState
+ ]),
+ "snmp_scan_function" : lambda oid:
oid(".1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.4.1.5951.1"),
+}