Module: check_mk
Branch: master
Commit: b7e7a65b97e70498eca5caa1ef01c92bf5be6824
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b7e7a65b97e704…
Author: Goetz Golla <gg(a)mathias-kettner.de>
Date: Wed Jan 21 12:47:46 2015 +0100
#1854 netscaler_tcp_conns: new check to monitor tcp connections on Citrix Netscaler
Loadbalancer Appliances
---
.werks/1854 | 9 ++++
ChangeLog | 1 +
checkman/netscaler_tcp_conns | 34 +++++++++++++++
checks/netscaler_tcp_conns | 78 ++++++++++++++++++++++++++++++++++
web/plugins/wato/check_parameters.py | 44 ++++++++++++++++++-
5 files changed, 165 insertions(+), 1 deletion(-)
diff --git a/.werks/1854 b/.werks/1854
new file mode 100644
index 0000000..fcbdb8e
--- /dev/null
+++ b/.werks/1854
@@ -0,0 +1,9 @@
+Title: netscaler_tcp_conns: new check to monitor tcp connections on Citrix Netscaler
Loadbalancer Appliances
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i1
+Date: 1421840838
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index f6f89bc..91b2cfe 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -48,6 +48,7 @@
NOTE: Please refer to the migration notes!
* 1525 viprinet_temp: Now uses new Temperature WATO rule...
NOTE: Please refer to the migration notes!
+ * 1854 netscaler_tcp_conns: new check to monitor tcp connections on Citrix Netscaler
Loadbalancer 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_tcp_conns b/checkman/netscaler_tcp_conns
new file mode 100644
index 0000000..e647567
--- /dev/null
+++ b/checkman/netscaler_tcp_conns
@@ -0,0 +1,34 @@
+title: Citrix Netscaler TCP Connections
+agents: snmp
+catalog: app/netscaler
+license: GPL
+distribution: check_mk
+description:
+
+ This check monitors the number of TCP connections on a Citrix Netscaler
+ Loadbalacing Appliance. It uses the {NS-ROOT-MIB} to access the
+ {nsTcpStatsGroup} via SNMP.
+
+ Monitored values are the number of TCP server connections and the number of
+ TCP client connections.
+
+ Warning and critical levels can be configured for these values.
+
+inventory:
+ One service per loadbalancer device will be created.
+
+perfdata:
+ The number of client connections and the number of client connections.
+
+[parameters]
+parameters(dict): parameters is a dictionary with a key for each monitored value.
+
+ {"server_conns"}: a tuple of warning and critical levels.
+
+ {"client conns"}: a tuple of warning and critical levels.
+
+ The numbers are integers.
+
+[configuration]
+netscaler_tcp_conns_default_levels(dict): This variable is preset to
+{{ "server_conns": (25000, 30000), "client_conns": (25000, 30000) }}
diff --git a/checks/netscaler_tcp_conns b/checks/netscaler_tcp_conns
new file mode 100644
index 0000000..5ffc69b
--- /dev/null
+++ b/checks/netscaler_tcp_conns
@@ -0,0 +1,78 @@
+#!/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.46.1.0 3
+# .1.3.6.1.4.1.5951.4.1.1.46.2.0 16
+
+factory_settings["netscaler_tcp_conns_default_levels"] = {
+ "server_conns" : (25000, 30000),
+ "client_conns" : (25000, 30000),
+}
+
+def inventory_netscaler_tcp_conns(info):
+ if info:
+ return[ (None, {}) ]
+
+def check_netscaler_tcp_conns(_no_item, params, info):
+ tcp_conns_types = {
+ "server_conns": (0, "Server Connections"),
+ "client_conns": (1, "Client Connections"),
+ }
+ for name, (index, infotext) in tcp_conns_types.iteritems():
+ value = int(info[0][index])
+ infotext += ": %d" % value
+ print params
+ if params.get(name):
+ warn, crit = params.get(name)
+ else:
+ warn, crit = None, None
+
+ perfdata = [ (name, value, warn, crit, 0) ]
+
+ state = 0
+ if crit and value >= crit:
+ state = 2
+ elif warn and value >= warn:
+ state = 1
+ if state > 0:
+ infotext += " (levels at %d/%d)" % (warn,crit)
+
+ yield state, infotext, perfdata
+
+check_info["netscaler_tcp_conns"] = {
+ "check_function" : check_netscaler_tcp_conns,
+ "inventory_function" : inventory_netscaler_tcp_conns,
+ "default_levels_variable" :
"netscaler_tcp_conns_default_levels",
+ "service_description" : "TCP Connections",
+ "has_perfdata" : True,
+ "group" : "netscaler_tcp_conns",
+ "snmp_info" : (".1.3.6.1.4.1.5951.4.1.1.46", [
+ 1, # tcpCurServerConn
+ 2, # tcpCurClientConn
+ ]),
+ "snmp_scan_function" : lambda oid:
oid(".1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.4.1.5951.1"),
+}
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index d65b304..ff6cdf3 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -7537,5 +7537,47 @@ register_check_parameters(
),
]
),
- None, None
+ None,
+ "dict"
+)
+
+register_check_parameters(
+ subgroup_applications,
+ "netscaler_tcp_conns",
+ _("Citrix Netscaler Loadbalancer TCP Connections"),
+ Dictionary(
+ elements = [
+ ( "client_conns",
+ Tuple(
+ title = _("Max. number of client connections"),
+ elements = [
+ Integer(
+ title = _("Warning at"),
+ default_value = 25000,
+ ),
+ Integer(
+ title = _("Critical at"),
+ default_value = 30000,
+ ),
+ ]
+ ),
+ ),
+ ( "server_conns",
+ Tuple(
+ title = _("Max. number of server connections"),
+ elements = [
+ Integer(
+ title = _("Warning at"),
+ default_value = 25000,
+ ),
+ Integer(
+ title = _("Critical at"),
+ default_value = 30000,
+ ),
+ ]
+ ),
+ ),
+ ]),
+ None,
+ "dict"
)