Module: check_mk
Branch: master
Commit: 856952b6ff804275f6d7a978e6fbeebef50a053e
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=856952b6ff8042…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Fri May 22 14:24:24 2015 +0200
#1250 alcatel_timetra_cpu: New CPU Check for Alcatel Switches supporting the TIMETRA MIB
---
.werks/1250 | 9 +++++++
ChangeLog | 1 +
checkman/alcatel_timetra_cpu | 13 ++++++++++
checks/alcatel_timetra_cpu | 57 ++++++++++++++++++++++++++++++++++++++++++
4 files changed, 80 insertions(+)
diff --git a/.werks/1250 b/.werks/1250
new file mode 100644
index 0000000..837ba28
--- /dev/null
+++ b/.werks/1250
@@ -0,0 +1,9 @@
+Title: alcatel_timetra_cpu: New CPU Check for Alcatel Switches supporting the TIMETRA
MIB
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i1
+Date: 1432297428
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index 4dad318..f9d7856 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -193,6 +193,7 @@
* 1248 acme_sbc, acme_sbc.settings: New Checks to monitor an ACME Session Border
Controller...
* 2256 mk_mysql: MySQL monitoring is now available for windows...
* 1249 alcatel_cpu, alcatel_temp: New checks for Alcatel switches based on IND1 MIB
+ * 1250 alcatel_timetra_cpu: New CPU Check for Alcatel Switches supporting the TIMETRA
MIB
* 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/alcatel_timetra_cpu b/checkman/alcatel_timetra_cpu
new file mode 100644
index 0000000..0096920
--- /dev/null
+++ b/checkman/alcatel_timetra_cpu
@@ -0,0 +1,13 @@
+title: Alcatel switches: CPU utilization
+agents: snmp
+catalog: hw/network/alcatel
+license: GPL
+distribution: check_mk
+description:
+ This Checks Monitors the cpu utilization on Alcatel switchtes supporting the
+ TIMETRA-CHASSIS-MIB. The shown value is an anverage calculated by the device.
+
+
+inventory:
+ One check is created
+
diff --git a/checks/alcatel_timetra_cpu b/checks/alcatel_timetra_cpu
new file mode 100644
index 0000000..81dc259
--- /dev/null
+++ b/checks/alcatel_timetra_cpu
@@ -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.
+
+alcatel_timetra_cpu_default_levels = (90.0, 95.0)
+
+def inventory_alcatel_timetra_cpu(info):
+ return [(None, "alcatel_timetra_cpu_default_levels")]
+
+def check_alcatel_timetra_cpu(_no_item, params, info):
+ cpu_perc = int(info[0][0])
+ warn, crit = params
+ state = 0
+ levelstext = ""
+ if cpu_perc >= crit:
+ state = 2
+ elif cpu_perc >= warn:
+ state = 1
+ if state:
+ levelstext = " (warn/crit at %.1f%%/%.1f%%)" % (warn, crit)
+ perfdata = [ ("util", cpu_perc, warn, crit, 0, 100) ]
+ return state, "total: %.1f%%" % cpu_perc + levelstext, perfdata
+
+
+check_info["alcatel_timetra_cpu"] = {
+ "check_function" : check_alcatel_timetra_cpu,
+ "inventory_function" : inventory_alcatel_timetra_cpu,
+ "service_description" : "CPU utilization",
+ "has_perfdata" : True,
+ "snmp_scan_function" : lambda oid: "TiMOS" in
oid(".1.3.6.1.2.1.1.1.0"),
+ "snmp_info" : (".1.3.6.1.4.1.6527.3.1.2.1.1", [ 1
]),
+ "group" : "cpu_utilization",
+
+}
+