Module: check_mk
Branch: master
Commit: 985bd3da167a8b4625f06c26e7c604eb080fca6b
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=985bd3da167a8b…
Author: Goetz Golla <gg(a)mathias-kettner.de>
Date: Wed Jun 17 08:16:25 2015 +0200
#2126 cisco_ace_rserver: new check to monitor real servers of Cisco ACE servers
---
.werks/2126 | 9 ++++
ChangeLog | 1 +
checkman/cisco_ace_rserver | 28 ++++++++++++
checks/cisco_ace_rserver | 93 +++++++++++++++++++++++++++++++++++++++
web/plugins/metrics/check_mk.py | 9 +++-
5 files changed, 139 insertions(+), 1 deletion(-)
diff --git a/.werks/2126 b/.werks/2126
new file mode 100644
index 0000000..5c347b2
--- /dev/null
+++ b/.werks/2126
@@ -0,0 +1,9 @@
+Title: cisco_ace_rserver: new check to monitor real servers of Cisco ACE servers
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i2
+Date: 1434521754
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index aa0e9a2..1ac8253 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -22,6 +22,7 @@
* 2124 datapower_pdrive, datapower_ldrive: new checks to monitor disk states of IBM
Datapower Gateways
* 2125 datapower_raid_bat: new check to monitor the battery of RAID controllers of
IBM Datapower Gateways
* 2330 ovs_bonding: Linux agent now supports OVS version 6.2...
+ * 2126 cisco_ace_rserver: new check to monitor real servers of Cisco ACE servers
* 2323 FIX: df: Fix new graphs for all filesystem checks in case of existing inode
information
* 2305 FIX: agent_vsphere, esx_vsphere_sensors: now able to handle sensor names with
semicolon...
* 2118 FIX: aix_sap_processlist: agent plugin now is more general to deal with
various AIX versions...
diff --git a/checkman/cisco_ace_rserver b/checkman/cisco_ace_rserver
new file mode 100644
index 0000000..83fcdab
--- /dev/null
+++ b/checkman/cisco_ace_rserver
@@ -0,0 +1,28 @@
+title: Cisco ACE Server: Status of Real Server
+agents: snmp
+catalog: hw/network/cisco
+license: GPL
+distribution: check_mk
+description:
+
+ This check monitors the status of the so-called real servers of Cisco
+ switches with the Application Control Engine (ACE) module. It uses snmp
+ to extract information from the CISCO-ENHANCED-SLB MIB.
+
+ The check monitors the operational and the administrative state of each
+ rserver, as well as the current number of connections. The criticality of
+ the check is determined from the operational state: if the operational
+ state is {in service}, the check is {OK}. If the operational state is
+ {probe testing} or {standby}, the check is {WARN}. Otherwise, it is {CRIT}.
+ If the administrative state is {out of service}, the worst total criticality
+ is {WARN}.
+
+item:
+ The name of the real server, or, if this is not configured on the device,
+ the IP-address of the real server.
+
+inventory:
+ One service for each real server is created
+
+perfdata:
+ The current number of connections going through a real server.
diff --git a/checks/cisco_ace_rserver b/checks/cisco_ace_rserver
new file mode 100644
index 0000000..1e9c30e
--- /dev/null
+++ b/checks/cisco_ace_rserver
@@ -0,0 +1,93 @@
+#!/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.
+
+
+def inventory_cisco_ace_rserver(info):
+ for name, ip, descr, admin_status, oper_status, conns in info:
+ if name != '':
+ item = name
+ elif descr != '':
+ item = descr
+ else:
+ item = socket.inet_ntoa(ip)
+ yield item, None
+
+def check_cisco_ace_rserver(item, _no_params, info):
+ admin_stati = {
+ "1": "in service",
+ "2": "out of service",
+ "3": "in service, standby",
+ }
+ oper_stati = {
+ "1": (2, "out of service"),
+ "2": (0, "in service"),
+ "3": (2, "failed"),
+ "4": (2, "ready to test"),
+ "5": (2, "testing"),
+ "6": (2, "max connection reached, throttling"),
+ "7": (2, "max clients reached, throttling"),
+ "8": (2, "dfp throttle"),
+ "9": (2, "probe failed"),
+ "10": (1, "probe testing"),
+ "11": (2, "oper wait"),
+ "12": (2, "test wait"),
+ "13": (2, "inband probe failed"),
+ "14": (2, "return code failed"),
+ "15": (2, "arp failed"),
+ "16": (1, "standby"),
+ "17": (2, "inactive"),
+ "18": (2, "max load reached"),
+ }
+
+ for name, ip, descr, admin_status, oper_status, conns in info:
+ ip_addr = socket.inet_ntoa(ip)
+ if name == item or ip_addr == item or descr == item:
+ admin_state = admin_stati[admin_status]
+ state, state_txt = oper_stati[oper_status]
+ if admin_status == "2" and state == 2:
+ state == 1 # max state is WARN if real server out of service
+ infotext = "Operational State: %s, Administrative State: %s, Current
Connections: %s" % \
+ (state_txt, admin_state, conns)
+ perfdata = [ ("connections", int(conns)) ]
+
+ return state, infotext, perfdata
+
+
+check_info['cisco_ace_rserver'] = {
+ "inventory_function" : inventory_cisco_ace_rserver,
+ "check_function" : check_cisco_ace_rserver,
+ "service_description" : "ACE RServer %s",
+ "snmp_info" : ( ".1.3.6.1.4.1.9.9.470.1.1.1.1", [ #
cesRserverEntry
+ "1", # cesRserverName
+ "4", # cesRserverIpAddress
+ "5", # cesRserverDescription
+ "12", # cesRserverAdminStatus
+ "13", # cesRserverOperStatus
+ "19", # cesRserverCurrConns
+ ] ),
+ "has_perfdata" : True,
+ "snmp_scan_function" : lambda oid: oid(".1.3.6.1.2.1.1.2.0") ==
".1.3.6.1.4.1.9.1.824",
+}
diff --git a/web/plugins/metrics/check_mk.py b/web/plugins/metrics/check_mk.py
index 93c5805..48735ec 100644
--- a/web/plugins/metrics/check_mk.py
+++ b/web/plugins/metrics/check_mk.py
@@ -1328,6 +1328,7 @@ check_metrics["check_mk-carel_sensors"]
= {}
check_metrics["check_mk-casa_cpu_temp"] = {}
check_metrics["check_mk-cisco_temp_perf"] = {}
check_metrics["check_mk-cisco_temp_sensor"] = {}
+check_metrics["check_mk-cisco_ace_rserver"] = {}
check_metrics["check_mk-climaveneta_temp"] = {}
check_metrics["check_mk-cmciii.temp"] = {}
check_metrics["check_mk-cmctc.temp"] = {}
@@ -1559,7 +1560,13 @@ perfometer_info.append(("stacked", [
perfometer_info.append(("linear", ( [ "running_sessions" ],
"total_sessions", None)))
perfometer_info.append(("linear", ( [ "shared_locks",
"exclusive_locks" ], None, None)))
-perfometer_info.append(("linear", ( [ "connections" ], 100,
None)))
+perfometer_info.append({
+ "type" : "logarithmic",
+ "metric" : "connections",
+ "half_value": 50,
+ "exponent" : 2
+})
+
perfometer_info.append(("logarithmic", ( "connection_time", 0.2,
2)))
perfometer_info.append(("dual", [