Module: check_mk
Branch: master
Commit: b04df555675a934e037e32e9ef7be2d9ae797153
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b04df555675a93…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Tue Jul 29 16:25:44 2014 +0200
#0186 touchstone_cable_modem_fec: New Check to monitor the Forward error correction on
touchstone cable modems
---
.werks/186 | 8 +++++
ChangeLog | 1 +
checkman/touchstone_cable_modem_fec | 15 +++++++++
checks/touchstone_cable_modem_fec | 57 ++++++++++++++++++++++++++++++++++
web/plugins/wato/check_parameters.py | 33 ++++++++++++++++++++
5 files changed, 114 insertions(+)
diff --git a/.werks/186 b/.werks/186
new file mode 100644
index 0000000..e9785af
--- /dev/null
+++ b/.werks/186
@@ -0,0 +1,8 @@
+Title: touchstone_cable_modem_fec: New Check to monitor the Forward error correction on
touchstone cable modems
+Level: 1
+Component: checks
+Version: 1.2.5i6
+Date: 1406643907
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index b9e0046..6cf5446 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,7 @@
Checks & Agents:
* 0185 knuerr_rms_humidity, knuerr_rms_temp: Two new Checks to Monitor the
Temperature and the Humidity on Knürr RMS Devices
* 1065 heartbeat_crm / heartbeat_crm.resources: Rewrote checks / formalized
parameters...
+ * 0186 touchstone_cable_modem_fec: New Check to monitor the Forward error correction
on touchstone cable modems
* 1051 FIX: tcp_conn_stats: fix missing performance data...
* 1142 FIX: winperf_ts_sessions: fix computation, check has never really worked
* 1090 FIX: zfsget: fixed exception which happened on incomplete zfs entries
diff --git a/checkman/touchstone_cable_modem_fec b/checkman/touchstone_cable_modem_fec
new file mode 100644
index 0000000..4a62c65
--- /dev/null
+++ b/checkman/touchstone_cable_modem_fec
@@ -0,0 +1,15 @@
+title: Touchstone Cable Modem: Forward error correction
+agents: snmp
+catalog: hw/network/arris
+license: GPL
+distribution:
+description:
+ This check monitors the Forward Error correction rate on Touchestone Cable Modems.
+ It is possible to set levels for good, uncorrected and corrected packages.
+
+item:
+ None
+
+inventory:
+ One service will be created
+
diff --git a/checks/touchstone_cable_modem_fec b/checks/touchstone_cable_modem_fec
new file mode 100644
index 0000000..daca175
--- /dev/null
+++ b/checks/touchstone_cable_modem_fec
@@ -0,0 +1,57 @@
+#!/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.
+
+factory_settings["touchstone_cable_modem_fec_default_levels"] = {
+ "good" : ( 250000000000, 260000000000 ),
+ "corrected" : ( 250000000000, 260000000000 ),
+ "uncorrected" : ( 250000000000, 260000000000 ),
+}
+
+def inventory_touchstone_cable_modem_fec(info):
+ return [ (None, {}) ]
+
+def check_touchstone_cable_modem_fec(_no_item, params, info):
+ fec = {}
+ fec['good'], fec['corrected'], fec['uncorrected'] = map(int,
info[0])
+ for what in ['good', 'corrected', 'uncorrected']:
+ warn, crit = params[what]
+ state = 0
+ if fec[what] >= crit:
+ state = 2
+ elif fec[what] >= warn:
+ state = 1
+ yield state, "FEC %s at %s" % ( what, fec[what] ), [ ( what, fec[what],
warn, crit ) ]
+
+check_info["touchstone_cable_modem_fec"] = {
+ "check_function" : check_touchstone_cable_modem_fec,
+ "inventory_function" : inventory_touchstone_cable_modem_fec,
+ "service_description" : "FEC",
+ "snmp_scan_function" : lambda oid: oid(".1.3.6.1.2.1.1.2.0")
== ".1.3.6.1.4.1.4115.820.1.0.0.0.0.0",
+ "snmp_info" : ( ".1.3.6.1.2.1.10.127.1.1.4.1", [ 2,
3, 4 ]),
+ "default_levels_variable" :
"touchstone_cable_modem_fec_default_levels",
+ "group" : "fec",
+}
+
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index 2dc57fc..101e891 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -1317,6 +1317,39 @@ register_check_parameters(
register_check_parameters(
subgroup_networking,
+ 'fec',
+ _("Forward error correction"),
+ Dictionary(
+ elements = [
+ ( 'good', Tuple(
+ title = _("Levels for good Packages"),
+ elements = [
+ Integer( title = _("Warning at"),
default_value="250000000000"),
+ Integer( title = _("Critical at"),
default_value="260000000000"),
+ ]
+ )),
+ ( 'corrected', Tuple(
+ title = _("Levels for corrected Packages"),
+ elements = [
+ Integer( title = _("Warning at"),
default_value="250000000000"),
+ Integer( title = _("Critical at"),
default_value="260000000000"),
+ ]
+ )),
+ ( 'uncorrected', Tuple(
+ title = _("Levels for uncorrected Packages"),
+ elements = [
+ Integer( title = _("Warning at"),
default_value="250000000000"),
+ Integer( title = _("Critical at"),
default_value="260000000000"),
+ ]
+ )),
+ ]
+ ),
+ None,
+ "dict"
+)
+
+register_check_parameters(
+ subgroup_networking,
"vpn_tunnel",
_("VPN Tunnel"),
Dictionary(