Module: check_mk
Branch: master
Commit: c4f9f6d85d5baf5235d66d5f3bd97ef9796013b4
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=c4f9f6d85d5baf…
Author: Goetz Golla <gg(a)mathias-kettner.de>
Date: Mon Feb 23 12:02:39 2015 +0100
#1862 netscaler_vserver: new check to monitor VServers on Citrix Netscaler Appliance
---
.werks/1862 | 9 +++++
ChangeLog | 1 +
checkman/netscaler_vserver | 18 +++++++++
checks/netscaler_vserver | 96 ++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 124 insertions(+)
diff --git a/.werks/1862 b/.werks/1862
new file mode 100644
index 0000000..edd8147
--- /dev/null
+++ b/.werks/1862
@@ -0,0 +1,9 @@
+Title: netscaler_vserver: new check to monitor VServers on Citrix Netscaler Appliance
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i1
+Date: 1424689326
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index aaf05ec..45f91fb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -90,6 +90,7 @@
NOTE: Please refer to the migration notes!
* 1889 cmciii.phase: New check to monitor input phases for Raritan PDUs
* 2005 services: change service description from service_ to Service or new
installations
+ * 1862 netscaler_vserver: new check to monitor VServers on Citrix Netscaler
Appliance
* 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_vserver b/checkman/netscaler_vserver
new file mode 100644
index 0000000..8fb161e
--- /dev/null
+++ b/checkman/netscaler_vserver
@@ -0,0 +1,18 @@
+title: Citrix Netscaler VServer Status
+agents: snmp
+catalog: app/netscaler
+license: GPL
+distribution: check_mk
+description:
+ This check monitors the status of the VServers of Citrix Netscaler
+ Loadbalacing Appliances. It uses snmp and the NS-ROOT-MIB to access the data.
+
+ The check is in the state OK when the VServer is in the state {UP}. It is in the
+ state CRIT when the VServer is in the state {DOWN}. It is in the state WARN in
+ all other cases.
+
+inventory:
+ One service per VServer will be created.
+
+item:
+ The name of the VServer.
diff --git a/checks/netscaler_vserver b/checks/netscaler_vserver
new file mode 100644
index 0000000..72e12b9
--- /dev/null
+++ b/checks/netscaler_vserver
@@ -0,0 +1,96 @@
+#!/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.
+#
+
+netscaler_vserver_states = {
+ 0: ("unknown", 1),
+ 1: ("down", 2),
+ 2: ("unknown", 1),
+ 3: ("busy", 1),
+ 4: ("out of service", 1),
+ 5: ("transition to out of service", 1),
+ 7: ("up", 0),
+}
+
+netscaler_vserver_types = (
+ "http",
+ "ftp",
+ "tcp",
+ "udp",
+ "sslBridge",
+ "monitor",
+ "monitorUdp",
+ "nntp",
+ "httpserver",
+ "httpclient",
+ "rpcserver",
+ "rpcclient",
+ "nat",
+ "any",
+ "ssl",
+ "dns",
+ "adns",
+ "snmp",
+ "ha",
+ "monitorPing",
+ "sslOtherTcp",
+ "aaa",
+ "secureMonitor",
+ "sslvpnUdp",
+ "rip",
+ "dnsClient",
+ "rpcServer",
+ "rpcClient",
+ "serviceUnknown",
+)
+
+def inventory_netscaler_vserver(info):
+ for line in info:
+ if line[0]:
+ yield line[0], None
+
+def check_netscaler_vserver(item, _no_params, info):
+ for line in info:
+ if line[0] == item:
+ name, ip, port, srv_type, srv_state = line
+ infotext = "State: %s, Type: %s, Socket:%s:%s" % \
+ (netscaler_vserver_states[int(srv_state)][0],
netscaler_vserver_types[int(srv_type)], ip, port)
+ state = netscaler_vserver_states[int(srv_state)][1]
+ return state, infotext
+
+check_info["netscaler_vserver"] = {
+ "check_function" : check_netscaler_vserver,
+ "inventory_function" : inventory_netscaler_vserver,
+ "service_description" : "VServer %s",
+ "snmp_info" : (".1.3.6.1.4.1.5951.4.1.3.1.1", [ #
nsVserverGroup.vserverTable.vserverEntry
+ 1, # vsvrName
+ 2, # vsvrIpAddress
+ 3, # vsvrPort
+ 4, # vsvrType
+ 5, # vsvrState
+ ]),
+ "snmp_scan_function" : lambda oid:
oid(".1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.4.1.5951.1"),
+}