2 # -*- encoding: utf-8; py-indent-offset: 4 -*-
3 # +------------------------------------------------------------------+
4 # | ____ _ _ __ __ _ __ |
5 # | / ___| |__ ___ ___| | __ | \/ | |/ / |
6 # | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
7 # | | |___| | | | __/ (__| < | | | | . \ |
8 # | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
10 # | Copyright Mathias Kettner 2014 mk@mathias-kettner.de |
11 # +------------------------------------------------------------------+
13 # This file is part of Check_MK.
14 # The official homepage is at http://mathias-kettner.de/check_mk.
16 # check_mk is free software; you can redistribute it and/or modify it
17 # under the terms of the GNU General Public License as published by
18 # the Free Software Foundation in version 2. check_mk is distributed
19 # in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-
20 # out even the implied warranty of MERCHANTABILITY or FITNESS FOR A
21 # PARTICULAR PURPOSE. See the GNU General Public License for more de-
22 # tails. You should have received a copy of the GNU General Public
23 # License along with GNU Make; see the file COPYING. If not, write
24 # to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
25 # Boston, MA 02110-1301 USA.
28 # .1.3.6.1.4.1.5951.4.1.1.23.3.0 1
29 # .1.3.6.1.4.1.5951.4.1.1.23.23.0 1
30 # .1.3.6.1.4.1.5951.4.1.1.23.24.0 3
32 netscaler_ha_cur_states
= {
34 # 1 Indicates that the node is in the process of becoming part of the high
35 # availability configuration.
36 1: ("initializing", 1),
37 2: ("down", 2), # undocumented
38 # 3 Indicates that the node is accessible and can function as either
39 # a primary or secondary node.
41 # 4 Indicates that one of the high availability monitored interfaces
42 # has failed because of a card or link failure. # This state triggers a
44 4: ("some HA monitored interfaces failed", 2),
45 5: ("monitorFail", 1), # undocumented
46 6: ("monitorOK", 1), # undocumented
47 # 7 Indicates that all the interfaces of the node are
48 # unusable because the interfaces on which high
49 # availability monitoring is enabled are not connected
50 # or are manually disabled. This state triggers a failover.
51 7: ("all HA monitored interfaces failed", 2),
52 # 8 Indicates that the node is in listening mode. It does not
53 # participate in high availability transitions or transfer
54 # configuration from the peer node. This is a configured
55 # value, not a statistic.
56 8: ("configured to listening mode (dumb)", 1),
57 # 9 Indicates that the high availability status of the node has been
58 # manually disabled. Synchronization and propagation cannot take
59 # place between the peer nodes.
60 9: ("HA status manually disabled", 1),
61 # 10 Indicates that the SSL card has failed. This state triggers a failover.
62 10: ("SSL card failed", 2),
63 # 11 Indicates that the route monitor has failed. This state triggers
65 11: ("route monitor has failed", 2),
68 netscaler_ha_peer_mode
= {
76 def inventory_netscaler_ha(info
):
81 def check_netscaler_ha(_no_item
, _no_params
, info
):
84 peer_state
, cur_status
, cur_state
= map(int, info
[0])
86 infotext
= "System not setup for HA"
88 infotext
= "State: %s, Neighbour: %s" % (
89 netscaler_ha_cur_states
[cur_state
][0],
90 netscaler_ha_peer_mode
[peer_state
][0],
92 state
= max(netscaler_ha_cur_states
[cur_state
][1],
93 netscaler_ha_peer_mode
[peer_state
][1])
95 return state
, infotext
98 check_info
["netscaler_ha"] = {
99 "check_function": check_netscaler_ha
,
100 "inventory_function": inventory_netscaler_ha
,
101 "service_description": "HA Node Status",
103 ".1.3.6.1.4.1.5951.4.1.1.23",
104 [ # nsHighAvailabilityGroup
109 "snmp_scan_function": lambda oid
: oid(".1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.4.1.5951.1"),