Module: check_mk
Branch: master
Commit: d142e338a4951d38876ffbeb173b4588aa842806
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d142e338a4951d…
Author: Goetz Golla <gg(a)mathias-kettner.de>
Date: Thu Dec 18 18:11:16 2014 +0100
#1459 netscaler_cpu: new check to monitor the CPUs of Citrix Netscaler Appliances
---
.werks/1459 | 9 ++++++
ChangeLog | 1 +
checkman/netscaler_cpu | 29 ++++++++++++++++++++
checks/netscaler_cpu | 71 ++++++++++++++++++++++++++++++++++++++++++++++++
modules/catalog.py | 1 +
5 files changed, 111 insertions(+)
diff --git a/.werks/1459 b/.werks/1459
new file mode 100644
index 0000000..fed25a9
--- /dev/null
+++ b/.werks/1459
@@ -0,0 +1,9 @@
+Title: netscaler_cpu: new check to monitor the CPUs of Citrix Netscaler Appliances
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i1
+Date: 1418922628
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index 101f197..29bf241 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -9,6 +9,7 @@
* 1207 services: Check can now be configured with additional names for matching...
* 1786 casa_cpu_mem, casa_cpu_temp, casa_cpu_util, casa_fan, casa_power: support more
devices, also C100G
* 1787 docsis_channels_upstream, docsis_channels_downstream: now also support CASA
100G
+ * 1459 netscaler_cpu: new check to monitor the CPUs of Citrix Netscaler 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_cpu b/checkman/netscaler_cpu
new file mode 100644
index 0000000..6d3661f
--- /dev/null
+++ b/checkman/netscaler_cpu
@@ -0,0 +1,29 @@
+title: Citrix Netscaler CPU Utilization
+agents: snmp
+catalog: app/netscaler
+license: GPL
+distribution: check_mk
+description:
+ This check monitors the CPU utilization on the Citrix Netscaler Loadbalacing
+ Appliance. It uses the {NS-ROOT-MIB} to access the CPU name {nsCPUname}
+ and CPU usage in percent {nsCPUusage}.
+
+ Warning and critical levels can be configured for the check.
+
+inventory:
+ One service per detected CPU will be created.
+
+perfdata:
+ The CPU utilization value in percent for every CPU
+
+item:
+ The name of the CPU
+
+[parameters]
+parameters(dict): parameters is a dictionary with one key
+
+ {"levels"}: a tuple of warning and critical levels for the CPU utilization.
+ The numbers are integers and represent a percentage value.
+
+[configuration]
+netscaler_cpu_default_levels(dict): This variable is preset to {{ "levels":
(90, 95) }}
diff --git a/checks/netscaler_cpu b/checks/netscaler_cpu
new file mode 100644
index 0000000..c87f521
--- /dev/null
+++ b/checks/netscaler_cpu
@@ -0,0 +1,71 @@
+#!/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.41.6.1.1.8.77.103.109.116.32.67.80.85 "Mgmt CPU"
+# .1.3.6.1.4.1.5951.4.1.1.41.6.1.1.12.80.97.99.107.101.116.32.67.80.85.32.48
"Packet CPU 0"
+# .1.3.6.1.4.1.5951.4.1.1.41.6.1.2.8.77.103.109.116.32.67.80.85 0
+# .1.3.6.1.4.1.5951.4.1.1.41.6.1.2.12.80.97.99.107.101.116.32.67.80.85.32.48 0
+
+factory_settings["netscaler_cpu_default_levels"] = {
+ "levels" : (90.0, 95.0)
+}
+
+def inventory_netscaler_cpu(info):
+ for cpu_name, cpu_usage in info:
+ yield cpu_name, netscaler_cpu_default_levels
+
+def check_netscaler_cpu(item, params, info):
+ warn, crit = params.get("levels")
+ for cpu_name, cpu_usage in info:
+ cpu_usage = int(cpu_usage)
+ if cpu_name == item:
+ infotext = "%d%%" % cpu_usage
+ perfdata = [ ("load", cpu_usage, warn, crit, 0) ]
+ state = 0
+ levelstext = ""
+ if cpu_usage >= crit:
+ state = 2
+ levelstext = " (levels at %d/%d)" % (warn,crit)
+ elif cpu_usage >= warn:
+ state = 1
+ levelstext = " (levels at %d/%d)" % (warn,crit)
+ infotext += levelstext
+ return state, infotext, perfdata
+
+check_info["netscaler_cpu"] = {
+ "check_function" : check_netscaler_cpu,
+ "inventory_function" : inventory_netscaler_cpu,
+ "default_levels_variable" : "netscaler_cpu_default_levels",
+ "service_description" : "CPU Utilization %s",
+ "has_perfdata" : True,
+ "group" : "cpu_utilization_multiitem",
+ "snmp_info" : (".1.3.6.1.4.1.5951.4.1.1.41.6.1", [
+ 1, # nsCPUname
+ 2, # nsCPUusage
+ ]),
+ "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/modules/catalog.py b/modules/catalog.py
index 36b392d..b67f46a 100644
--- a/modules/catalog.py
+++ b/modules/catalog.py
@@ -90,6 +90,7 @@ manpage_catalog_titles = {
"apache" : "Apache Webserver",
"db2" : "IBM DB2",
"citrix" : "Citrix",
+ "netscaler" : "Citrix Netscaler",
"exchange" : "Microsoft Exchange",
"java" : "Java (Tomcat, Weblogic, JBoss, etc.)",
"libelle" : "Libelle Business Shadow",