Module: check_mk
Branch: master
Commit: aa9b73d33cef0d47a089225ff293d434981fbdab
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=aa9b73d33cef0d…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Fri May 22 14:20:25 2015 +0200
#1249 alcatel_cpu, alcatel_temp: New checks for Alcatel switches based on IND1 MIB
---
.werks/1249 | 9 +++++++++
ChangeLog | 1 +
checkman/alcatel_cpu | 12 +++++++++++
checkman/alcatel_temp | 12 +++++++++++
checks/alcatel_cpu | 54 +++++++++++++++++++++++++++++++++++++++++++++++++
checks/alcatel_temp | 54 +++++++++++++++++++++++++++++++++++++++++++++++++
6 files changed, 142 insertions(+)
diff --git a/.werks/1249 b/.werks/1249
new file mode 100644
index 0000000..d1bd237
--- /dev/null
+++ b/.werks/1249
@@ -0,0 +1,9 @@
+Title: alcatel_cpu, alcatel_temp: New checks for Alcatel switches based on IND1 MIB
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i1
+Date: 1432297189
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index b46855b..4dad318 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -192,6 +192,7 @@
* 1247 alcatel_timetra_chassis: New Check for Slots, Power Supplies, MDAs, cf cards
and Fans of Alcatel Switches Supporting the TIMETRA-CHASSIS-MIB
* 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
* 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_cpu b/checkman/alcatel_cpu
new file mode 100644
index 0000000..0f4ed01
--- /dev/null
+++ b/checkman/alcatel_cpu
@@ -0,0 +1,12 @@
+title: Alcatel switches: CPU utilization
+agents: snmp
+catalog: hw/network/alcatel
+license: GPL
+distribution: check_mk
+description:
+ This Check Monitors the CPU utilization on Alcatel switches supporting the
ALCATEL-IND1-HEALTH-MIB.
+ The value is a average in percent over the last hour. This average is calculated by the
device.
+
+inventory:
+ One check is created
+
diff --git a/checkman/alcatel_temp b/checkman/alcatel_temp
new file mode 100644
index 0000000..c7c4edf
--- /dev/null
+++ b/checkman/alcatel_temp
@@ -0,0 +1,12 @@
+title: Alcatel switches: Board and CPU Temperature
+agents: snmp
+catalog: hw/network/alcatel
+license: GPL
+distribution: check_mk
+description:
+ This Check Monitors CPU and Board Temperatures on Alcatel switches supporting the
ALCATEL-IND1-CHASSIS-MIB.
+ If the CPU Temperature is supported depends on the switch mode (not supported on Hawk
models)
+
+inventory:
+ One check is created
+
diff --git a/checks/alcatel_cpu b/checks/alcatel_cpu
new file mode 100644
index 0000000..09bc1ae
--- /dev/null
+++ b/checks/alcatel_cpu
@@ -0,0 +1,54 @@
+#!/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.
+
+alcatel_cpu_default_levels = (90.0, 95.0)
+
+def inventory_alcatel_cpu(info):
+ return [(None, "alcatel_cpu_default_levels")]
+
+def check_alcatel_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_cpu"] = {
+ "check_function" : check_alcatel_cpu,
+ "inventory_function" : inventory_alcatel_cpu,
+ "service_description" : "CPU utilization",
+ "has_perfdata" : True,
+ "snmp_scan_function" : lambda oid:
oid(".1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.4.1.6486.800"),
+ "snmp_info" :
(".1.3.6.1.4.1.6486.800.1.2.1.16.1.1.1", [13]),
+}
+
diff --git a/checks/alcatel_temp b/checks/alcatel_temp
new file mode 100644
index 0000000..fa57f38
--- /dev/null
+++ b/checks/alcatel_temp
@@ -0,0 +1,54 @@
+#!/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.
+
+factory_settings['alcatel_temp'] = {
+ "levels" : ( 45, 50 ),
+}
+
+def inventory_alcatel_temp(info):
+ for oid, name in enumerate(["Board", "CPU"]):
+ if info[0][oid] != '0':
+ yield name, {}
+
+def check_alcatel_temp(item, params, info):
+ items = { "Board" : 0, "CPU": 1 }
+ temp_celsius = int(info[0][items[item]])
+ return check_temperature(temp_celsius, params)
+
+check_info["alcatel_temp"] = {
+ "check_function" : check_alcatel_temp,
+ "inventory_function" : inventory_alcatel_temp,
+ "service_description" : "Temperature %s",
+ "group" : "temperature",
+ "default_levels_variable" : "alcatel_temp",
+ "has_perfdata" : True,
+ "snmp_scan_function" : lambda oid:
oid(".1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.4.1.6486.800"),
+ "snmp_info" :
(".1.3.6.1.4.1.6486.800.1.1.1.3.1.1.3.1", [
+ 4, #
chasHardwareBoardTemp
+ 5, #
chasHardwareCpuTemp
+ ]),
+ "includes" : [ "temperature.include" ],
+}