Module: check_mk
Branch: master
Commit: 75f2596c1f4dcc4e8814ede9f39c25d1fa48f056
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=75f2596c1f4dcc…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Thu Nov 19 18:46:48 2015 +0100
#2797 netscaler_vserver: now also shows tftp servers and health state of loadbalacing
entities
---
.werks/2797 | 9 ++++
ChangeLog | 1 +
checkman/netscaler_vserver | 3 ++
checks/netscaler_vserver | 112 +++++++++++++++++++++++++++-----------------
4 files changed, 82 insertions(+), 43 deletions(-)
diff --git a/.werks/2797 b/.werks/2797
new file mode 100644
index 0000000..36ff1e7
--- /dev/null
+++ b/.werks/2797
@@ -0,0 +1,9 @@
+Title: netscaler_vserver: now also shows tftp servers and health state of loadbalacing
entities
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i4
+Date: 1447955060
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index a9da207..275a89c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -36,6 +36,7 @@
* 2710 arbor_peakflow_sp, arbor_peakflow_sp.cpu_load, arbor_peakflow_sp.disk_usage,
arbor_peakflow_sp.flows, arbor_peakflow_tms, arbor_peakflow_tms.cpu_load,
arbor_peakflow_tms.disk_usage, arbor_peakflow_tms.host_fault, arbor_peakflow_tms.updates,
arbor_pravail, arbor_pravail.cpu_load, arbor_pravail.disk_usage, arbor_pravail.host_fault:
new checks for various arbor devices
* 2711 janitza_umg: added support for umg508...
* 2792 check_mk_agent.aix: now able to use wildcards in the fileinfo.cfg
+ * 2797 netscaler_vserver: now also shows tftp servers and health state of
loadbalacing entities
* 2660 FIX: fixed windows agent using the wrong working directory...
* 2664 FIX: ps: Speedup in situation with many matching processes...
* 2661 FIX: windows agent: fixed incomplete process list...
diff --git a/checkman/netscaler_vserver b/checkman/netscaler_vserver
index 8fb161e..b1db83c 100644
--- a/checkman/netscaler_vserver
+++ b/checkman/netscaler_vserver
@@ -11,6 +11,9 @@ description:
state CRIT when the VServer is in the state {DOWN}. It is in the state WARN in
all other cases.
+ For loadbalancing entities is also shows the health state. The check goes WARN if
+ the health is below 100 percent and CRIT when the health drops to zero.
+
inventory:
One service per VServer will be created.
diff --git a/checks/netscaler_vserver b/checks/netscaler_vserver
index 72e12b9..b2f55ff 100644
--- a/checks/netscaler_vserver
+++ b/checks/netscaler_vserver
@@ -26,46 +26,57 @@
#
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),
+ "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 = {
+ "0" :"http",
+ "1" :"ftp",
+ "2" :"tcp",
+ "3" :"udp",
+ "4" :"sslBridge",
+ "5" :"monitor",
+ "6" :"monitorUdp",
+ "7" :"nntp",
+ "8" :"httpserver",
+ "9" :"httpclient",
+ "10" :"rpcserver",
+ "11" :"rpcclient",
+ "12" :"nat",
+ "13" :"any",
+ "14" :"ssl",
+ "15" :"dns",
+ "16" :"adns",
+ "17" :"snmp",
+ "18" :"ha",
+ "19" :"monitorPing",
+ "20" :"sslOtherTcp",
+ "21" :"aaa",
+ "23" :"secureMonitor",
+ "24" :"sslvpnUdp",
+ "25" :"rip",
+ "26" :"dnsClient",
+ "27" :"rpcServer",
+ "28" :"rpcClient",
+ "62" :"serviceUnknown",
+ "69" :"tftp",
+}
+
+netscaler_vserver_entitytypes = {
+ "0" :"unknown",
+ "1" :"loadbalancing",
+ "2" :"loadbalancinggroup",
+ "3" :"sslvpn",
+ "4" :"contentswitching",
+ "5" :"cacheredirection",
}
-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:
@@ -75,11 +86,24 @@ def inventory_netscaler_vserver(info):
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
+ state = 0
+ name, ip, port, svr_type, svr_state, svr_health, svr_entitytype = line
+
+ svr_state_info = netscaler_vserver_states.get(svr_state,
("unknown", 1))
+ yield svr_state_info[1], "State: %s" % svr_state_info[0]
+
+ if svr_entitytype in [ "1", "2" ]:
+ health_perc = int(svr_health)
+ health_state = 0
+ if health_perc == 0:
+ health_state = 2
+ elif health_perc < 100:
+ health_state = 1
+ yield health_state, "Health at: %s%%" % health_perc
+
+ yield 0, "Type: %s" %
netscaler_vserver_entitytypes.get(svr_entitytype , "unknown")
+ yield 0, "Protocol: %s" % netscaler_vserver_types.get(svr_type,
"serviceUnknown")
+ yield 0, "Socket: %s:%s" % (ip, port)
check_info["netscaler_vserver"] = {
"check_function" : check_netscaler_vserver,
@@ -91,6 +115,8 @@ check_info["netscaler_vserver"] = {
3, # vsvrPort
4, # vsvrType
5, # vsvrState
+ 62, # vsvrHealth
+ 64, # vsvrEntityType
]),
"snmp_scan_function" : lambda oid:
oid(".1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.4.1.5951.1"),
}