Module: check_mk
Branch: master
Commit: 03b0dbddcdd4dfa1cc3fd6ab5465404ac59659c7
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=03b0dbddcdd4df…
Author: Goetz Golla <gg(a)mathias-kettner.de>
Date: Fri Jan 9 14:38:25 2015 +0100
#1464 netscaler_mem: new check to monitor the memory usage of Citrix Netscaler Appliances
---
.werks/1464 | 9 ++++
ChangeLog | 1 +
checkman/netscaler_mem | 27 ++++++++++++
checks/netscaler_mem | 67 ++++++++++++++++++++++++++++++
pnp-templates/check_mk-netscaler_mem.php | 1 +
web/plugins/perfometer/check_mk.py | 1 +
web/plugins/wato/check_parameters.py | 15 +++++++
7 files changed, 121 insertions(+)
diff --git a/.werks/1464 b/.werks/1464
new file mode 100644
index 0000000..7bc83da
--- /dev/null
+++ b/.werks/1464
@@ -0,0 +1,9 @@
+Title: netscaler_mem: new check to monitor the memory usage of Citrix Netscaler
Appliances
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i1
+Date: 1420810662
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index 6211340..6572cb7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -26,6 +26,7 @@
* 1831 diskstat: detect multipath devices and handle them instead of the physical
paths...
* 1462 netscaler_ha: new check to monitor the HA state of Citrix Netscaler
appliances
* 1838 emc_datadomain_mtree: New check for EMC Datadomain MTrees...
+ * 1464 netscaler_mem: new check to monitor the memory usage 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_mem b/checkman/netscaler_mem
new file mode 100644
index 0000000..970479a
--- /dev/null
+++ b/checkman/netscaler_mem
@@ -0,0 +1,27 @@
+title: Citrix Netscaler Memory Utilization
+agents: snmp
+catalog: app/netscaler
+license: GPL
+distribution: check_mk
+description:
+
+ This check monitors the Memmory utilization on the Citrix Netscaler
+ Appliance. It uses the NS-ROOT-MIB to access the amount of used memory
+ {resMemUsage} in percent and the total installed memory {memSizeMB}.
+
+ Warning and critical levels can be configured for the check.
+
+inventory:
+ One service per appliance will be created.
+
+perfdata:
+ The memory utilization value
+
+[parameters]
+warning (float): The percentage of memory usage that triggers a warning level.
+critical (float): The percentage of memory usage that triggers a critical level.
+
+[configuration]
+netscaler_mem_default_levels (float, float): Default levels for warning and critical
used
+ by inventorized checks. This is preset to {(80.0, 90.0)}
+
diff --git a/checks/netscaler_mem b/checks/netscaler_mem
new file mode 100644
index 0000000..9bb54b1
--- /dev/null
+++ b/checks/netscaler_mem
@@ -0,0 +1,67 @@
+#!/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.2.0 13
+# .1.3.6.1.4.1.5951.4.1.1.41.4.0 7902
+
+netscaler_mem_default_levels = (80.0, 90.0)
+
+def inventory_netscaler_mem(info):
+ if info:
+ return [ (None, 'netscaler_mem_default_levels') ]
+
+def check_netscaler_mem(_no_item, params, info):
+ used_mem_perc, total_mem_mb = map(float, info[0])
+ warn_perc, crit_perc = params
+ total_mem = total_mem_mb * 1024 * 1024
+ warn, crit, used_mem = map(lambda s: s * total_mem / 100.0, params +
(used_mem_perc,) )
+ infotext = "%s (%d%%) of %s" % ( get_bytes_human_readable(used_mem),
used_mem_perc,
+ get_bytes_human_readable(total_mem) )
+ perfdata = [ ("mem", used_mem, warn, crit, 0, total_mem ) ]
+
+ state = 0
+ if used_mem >= crit:
+ state = 2
+ infotext += " (levels at %.1f%%/%.1f%%)" % (warn_perc, crit_perc)
+ elif used_mem >= warn:
+ state = 1
+ infotext += " (levels at %.1f%%/%.1f%%)" % (warn_perc, crit_perc)
+
+ return state, infotext, perfdata
+
+check_info["netscaler_mem"] = {
+ "check_function" : check_netscaler_mem,
+ "inventory_function" : inventory_netscaler_mem,
+ "service_description" : "Memory used",
+ "has_perfdata" : True,
+ "group" : "netscaler_mem",
+ "snmp_info" : (".1.3.6.1.4.1.5951.4.1.1.41", [ #
nsResourceGroup
+ 2, # resMemUsage
+ 4, # memSizeMB
+ ]),
+ "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/pnp-templates/check_mk-netscaler_mem.php
b/pnp-templates/check_mk-netscaler_mem.php
new file mode 120000
index 0000000..64bb7b4
--- /dev/null
+++ b/pnp-templates/check_mk-netscaler_mem.php
@@ -0,0 +1 @@
+check_mk-juniper_screenos_mem.php
\ No newline at end of file
diff --git a/web/plugins/perfometer/check_mk.py b/web/plugins/perfometer/check_mk.py
index 52ae655..37da111 100644
--- a/web/plugins/perfometer/check_mk.py
+++ b/web/plugins/perfometer/check_mk.py
@@ -956,6 +956,7 @@ perfometers['check_mk-esx_vsphere_hostsystem.mem_usage'] =
perfometer_simple_mem
perfometers['check_mk-brocade_mlx.module_mem'] = perfometer_simple_mem_usage
perfometers['check_mk-innovaphone_mem'] = perfometer_simple_mem_usage
perfometers['check_mk-juniper_screenos_mem'] = perfometer_simple_mem_usage
+perfometers['check_mk-netscaler_mem'] = perfometer_simple_mem_usage
perfometers['check_mk-arris_cmts_mem'] = perfometer_simple_mem_usage
perfometers["check_mk-juniper_trpz_mem"] = perfometer_simple_mem_usage
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index 3a394a9..e6e9fa8 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -2620,6 +2620,21 @@ register_check_parameters(
register_check_parameters(
subgroup_os,
+ "netscaler_mem",
+ _("Netscaler Memory Usage"),
+ Tuple(
+ title = _("Specify levels in percentage of total memory usage"),
+ elements = [
+ Percentage(title = _("Warning at a usage of"), unit =_("% of
RAM"), default_value = 80.0, maxvalue = 100.0 ),
+ Percentage(title = _("Critical at a usage of"), unit =_("% of
RAM"), default_value = 90.0, maxvalue = 100.0 )
+ ]
+ ),
+ None,
+ "first"
+)
+
+register_check_parameters(
+ subgroup_os,
"general_flash_usage",
_("Flash Space Usage"),
Alternative(