Module: check_mk
Branch: master
Commit: d23c8cb5a121876921dfa17ddb58153cbeedd84a
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d23c8cb5a12187…
Author: Andreas Boesl <ab(a)mathias-kettner.de>
Date: Thu Apr 3 15:15:49 2014 +0200
enterasys_lsnat: new check monitoring the current LSNAT bindings
---
.werks/783 | 8 +++++
ChangeLog | 1 +
checkman/enterasys_lsnat | 17 ++++++++++
checks/enterasys_lsnat | 59 ++++++++++++++++++++++++++++++++++
web/plugins/wato/check_parameters.py | 22 +++++++++++++
5 files changed, 107 insertions(+)
diff --git a/.werks/783 b/.werks/783
new file mode 100644
index 0000000..c4c9727
--- /dev/null
+++ b/.werks/783
@@ -0,0 +1,8 @@
+Title: enterasys_lsnat: new check monitoring the current LSNAT bindings
+Level: 1
+Component: checks
+Version: 1.2.5i3
+Date: 1396530940
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index 527b30f..8f32594 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,7 @@
Checks & Agents:
* 0149 cisco_secure: New check for Port Security on Cisco swichtes
* 0751 New localcheck for Linux that makes sure that filesystems in /etc/fstab are
mounted...
+ * 0783 enterasys_lsnat: new check monitoring the current LSNAT bindings
* 0777 FIX: special agent emcvnx: did not work with security file authentication...
Multisite:
diff --git a/checkman/enterasys_lsnat b/checkman/enterasys_lsnat
new file mode 100644
index 0000000..4c4953b
--- /dev/null
+++ b/checkman/enterasys_lsnat
@@ -0,0 +1,17 @@
+title: Enterasys: LSNAT bindings
+agents: snmp
+catalog: hw/network/enterasys
+license: GPL
+distribution: check_mk
+description:
+ This check monitors the number of current LSNAT bindings if the feature is activated
+ on this device (oid .1.3.6.1.4.1.5624.1.2.74.1.1.5.0 must contain a value)
+
+inventory:
+ One check is created for each Enterasys device
+
+[parameters]
+parameters (dict): A dictionary with the following optional keys:
+
+ {"current_bindings"}: tuple(int, int) representing the warn and crit limits
for this check
+
diff --git a/checks/enterasys_lsnat b/checks/enterasys_lsnat
new file mode 100644
index 0000000..e38169d
--- /dev/null
+++ b/checks/enterasys_lsnat
@@ -0,0 +1,59 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2013 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_enterasys_lsnat(info):
+ return [ (None, {}) ]
+
+def check_enterasys_lsnat(no_item, params, info):
+ if not info:
+ return 3, "LSNAT bindings info is missing"
+
+ lsnat_bindings = saveint(info[0][0])
+ warn, crit = params.get("current_bindings", (None, None))
+
+ state = 0
+ state_info = ""
+ if warn:
+ if lsnat_bindings > crit:
+ state = 2
+ state_info = state_markers[state]
+ elif lsnat_bindings > warn:
+ state = 1
+ state_info = state_markers[state]
+
+ return state, "Current bindings %d%s" % (lsnat_bindings, state_info)
+
+
+check_info["enterasys_lsnat"] = {
+ "check_function" : check_enterasys_lsnat,
+ "inventory_function" : inventory_enterasys_lsnat,
+ "service_description" : "LSNAT Bindings",
+ "group" : "lsnat",
+ "snmp_info" : ( ".1.3.6.1.4.1.5624.1.2.74.1.1.5", [
"0" ] ),
+ "snmp_scan_function" : lambda oid:
oid(".1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.4.1.5624.2.1") and
+
oid(".1.3.6.1.4.1.5624.1.2.74.1.1.5.0"),
+}
+
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index 4b80934..2c7918d 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -1295,6 +1295,28 @@ register_check_parameters(
register_check_parameters(
subgroup_networking,
+ "lsnat",
+ _("Enterasys LSNAT Bindings"),
+ Dictionary(
+ elements = [
+ ( "current_bindings",
+ Tuple(
+ title = _("Number of current LSNAT bindings"),
+ elements = [
+ Integer(title = _("Warning if above"), size =
10, unit=_("bindings")),
+ Integer(title = _("Critical if above"), size =
10, unit=_("bindings")),
+ ]
+ )
+ ),
+ ],
+ optional_keys = False,
+ ),
+ None,
+ "dict"
+)
+
+register_check_parameters(
+ subgroup_networking,
"wlc_clients",
_("WLC WiFi client connections"),
Tuple(