Module: check_mk
Branch: master
Commit: e9ac966b137e41a0792e8efe1598d2e136535b97
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=e9ac966b137e41…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Wed Jul 30 15:20:33 2014 +0200
#0188 touchstone_cable_modem_frequency: New check for line frequency in Mhz
---
.werks/188 | 8 +++++
ChangeLog | 2 ++
checkman/touchstone_cable_modem_fec | 2 +-
checkman/touchstone_cable_modem_frequency | 14 ++++++++
checks/touchstone_cable_modem_frequency | 55 +++++++++++++++++++++++++++++
web/plugins/wato/check_parameters.py | 14 ++++++++
6 files changed, 94 insertions(+), 1 deletion(-)
diff --git a/.werks/188 b/.werks/188
new file mode 100644
index 0000000..6228bfc
--- /dev/null
+++ b/.werks/188
@@ -0,0 +1,8 @@
+Title: touchstone_cable_modem_frequency: New check for line frequency in Mhz
+Level: 1
+Component: checks
+Version: 1.2.5i6
+Date: 1406726413
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index f19e236..5de59cb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,7 @@
* 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
* 1068 livedump: Added optional check interval (detect staleness) / option to encrypt
mails...
+ * 0188 touchstone_cable_modem_frequency: New check for line frequency in Mhz
* 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
@@ -17,6 +18,7 @@
* 1064 FIX: Fixed rare issue with WATO communication in distributed setups (different
OS versions)...
* 1089 FIX: Snapshot restore: fixed exception during exception handling......
* 1091 FIX: logwatch patterns: allow unicode text in pattern comment
+ * 1092 FIX: logwatch: now able to enter unicode text into the "Pattern
(Regex)" field
1.2.5i5:
diff --git a/checkman/touchstone_cable_modem_fec b/checkman/touchstone_cable_modem_fec
index 0ebc7e9..67183fa 100644
--- a/checkman/touchstone_cable_modem_fec
+++ b/checkman/touchstone_cable_modem_fec
@@ -5,7 +5,7 @@ license: GPL
distribution:
description:
This check monitors the Forward Error correction rate on Touchestone Cable Modems.
- It is possible to set levels in percent fir uncorrected and corrected packages.
+ It is possible to set levels in percent for uncorrected and corrected packages.
item:
None
diff --git a/checkman/touchstone_cable_modem_frequency
b/checkman/touchstone_cable_modem_frequency
new file mode 100644
index 0000000..7d9c3f4
--- /dev/null
+++ b/checkman/touchstone_cable_modem_frequency
@@ -0,0 +1,14 @@
+title: Touchstone Cable Modem: Frequency
+agents: snmp
+catalog: hw/network/arris
+license: GPL
+distribution:
+description:
+ This check monitors the frequency on the modem line in Mhz. Levels for {WARN} and {CRIT}
can be set.
+
+item:
+ None
+
+inventory:
+ One service will be created
+
diff --git a/checks/touchstone_cable_modem_frequency
b/checks/touchstone_cable_modem_frequency
new file mode 100644
index 0000000..2c3e1a1
--- /dev/null
+++ b/checks/touchstone_cable_modem_frequency
@@ -0,0 +1,55 @@
+#!/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.
+
+touchstone_cable_modem_frequency_default_levels = ( 155, 163 )
+
+def inventory_touchstone_cable_modem_frequency(info):
+ return [ (None, "touchstone_cable_modem_frequency_default_levels") ]
+
+def check_touchstone_cable_modem_frequency(_no_item, params, info):
+ mhz = int(info[0][0]) / 1000000
+ infotext = "Current Frequence is %d Mhz" % mhz
+ warn, crit = params
+ perfdata = [("frequence" , mhz, warn, crit )]
+ levels = " (Levels Warn/Crit at %d Mhz/ %d Mhz)" % ( warn, crit )
+ state = 0
+ if mhz >= crit:
+ state = 2
+ infotext += levels
+ elif mhz >= warn:
+ state = 1
+ infotext += levels
+ return state, infotext, perfdata
+
+check_info["touchstone_cable_modem_frequency"] = {
+ "check_function" : check_touchstone_cable_modem_frequency,
+ "inventory_function" : inventory_touchstone_cable_modem_frequency,
+ "service_description" : "Frequency",
+ "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.1.1.2", [
3 ]),
+ "group" : "network_freq_single",
+}
+
diff --git a/web/plugins/wato/check_parameters.py b/web/plugins/wato/check_parameters.py
index 6953a04..3dbe574 100644
--- a/web/plugins/wato/check_parameters.py
+++ b/web/plugins/wato/check_parameters.py
@@ -5503,6 +5503,20 @@ register_check_parameters(
),
register_check_parameters(
+ subgroup_networking,
+ "network_freq_single",
+ _("Modem Frequencies"), # Name can be changed if the rule is used for
another check
+ Tuple(
+ help = _("Levels for the frequencies of network devices like modems."
),
+ elements = [
+ Integer(title = _("warning if at"), unit = "Mhz",
default_value = 155 ),
+ Integer(title = _("critical if at"), unit = "Mhz",
default_value = 163 ),
+ ]),
+ None,
+ "first"
+)
+
+register_check_parameters(
subgroup_storage,
"fc_port",
_("FibreChannel Ports (FCMGMT MIB)"),