Module: check_mk
Branch: master
Commit: b5667445e15ee2faee64ce849a8a5a40fd26ae93
URL: http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=b5667445e15ee2…
Author: Bernd Stroessenreuther <bs(a)mathias-kettner.de>
Date: Fri Apr 25 12:29:31 2014 +0200
enterasys_temp: New Check for temperature sensor in Enterasys Switches
---
.werks/899 | 8 ++++
ChangeLog | 1 +
checkman/enterasys_temp | 27 ++++++++++++
checks/enterasys_temp | 65 +++++++++++++++++++++++++++++
pnp-templates/check_mk-enterasys_temp.php | 1 +
web/plugins/perfometer/check_mk.py | 1 +
6 files changed, 103 insertions(+)
diff --git a/.werks/899 b/.werks/899
new file mode 100644
index 0000000..6848a3f
--- /dev/null
+++ b/.werks/899
@@ -0,0 +1,8 @@
+Title: enterasys_temp: New Check for temperature sensor in Enterasys Switches
+Level: 2
+Component: checks
+Version: 1.2.5i3
+Date: 1398421742
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index 497efe2..c88bed1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -38,6 +38,7 @@
* 0897 wagner_titanus_topsense.temp: New Check for Temperature measured by Wagner Titanus Top Sens devices
* 0898 ibm_svc_nodestats.disk_latency, ibm_svc_systemstats.disk_latency: New Checks for Disk Latency in IBM SVC / Storwize V3700 / V7000 devices
* 0156 akcp_daisy_temp: New Check for akcp daisyTemp sensor chains...
+ * 0899 enterasys_temp: New Check for temperature sensor in Enterasys Switches
* 0777 FIX: special agent emcvnx: did not work with security file authentication...
* 0786 FIX: zfsget: fixed compatibility with older Solaris agents...
* 0809 FIX: brocade_fcport: Fixed recently introduced problem with port speed detection
diff --git a/checkman/enterasys_temp b/checkman/enterasys_temp
new file mode 100644
index 0000000..1dc26aa
--- /dev/null
+++ b/checkman/enterasys_temp
@@ -0,0 +1,27 @@
+title: Enterasys Switch: Temperature
+agents: snmp
+catalog: hw/network/enterasys
+license: GPL
+distribution: check_mk
+description:
+ Checks the temperature measured by the temperature sensor in Enterasys
+ Switches.
+
+ Returns {WARN} or {CRIT} if reaching or exceeding given levels and {OK}
+ otherwise.
+
+inventory:
+ Creates one service on every Enterasys Switch in which a temperature
+ sensor is found to be active.
+
+perfdata:
+ One value: The temperature in degree celsius, together with it's warn and
+ crit levels.
+
+[parameters]
+warning (int): The temperature in degree celsius that triggers a WARNING state.
+critical (int): The temperature in degree celsius that triggers a CRITICAL state.
+
+[configuration]
+enterasys_temp_default_levels(int, int): The default levels for WARNING and
+ CRITICAL state, preset to (30, 35)
diff --git a/checks/enterasys_temp b/checks/enterasys_temp
new file mode 100644
index 0000000..aa1c206
--- /dev/null
+++ b/checks/enterasys_temp
@@ -0,0 +1,65 @@
+#!/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.
+
+enterasys_temp_default_levels = (30, 35)
+
+def inventory_enterasys_temp(info):
+ if info[0][0] == "0":
+ return []
+ else:
+ return [ (None, "enterasys_temp_default_levels") ]
+
+def check_enterasys_temp(item, params, info):
+ warn, crit = params
+
+ # info for MIB: The ambient temperature of the room in which the chassis
+ # is located. If this sensor is broken or not supported, then
+ # this object will be set to zero. The value of this object
+ # is the actual temperature in degrees Fahrenheit * 10.
+ temp_value_snmp = int(info[0][0])
+ temp_c = (temp_value_snmp / 10 - 32) / 1.8
+ temp_c = float("%0.1f" % temp_c)
+
+ perfdata = [ ("temp", str(temp_c) + "C", warn, crit) ]
+ infotext = "Temperature is %0.1f C (warn/crit at %0.1f/%0.1f C)" % (temp_c, warn, crit)
+ status = 0
+ if temp_c >= crit:
+ status = 2
+ elif temp_c >= warn:
+ status = 1
+
+ return status, infotext, perfdata
+
+check_info["enterasys_temp"] = {
+ "check_function" : check_enterasys_temp,
+ "inventory_function" : inventory_enterasys_temp,
+ "service_description" : "Temperature",
+ "has_perfdata" : True,
+ "snmp_info" : ( ".1.3.6.1.4.1.52.4.1.1.8.1", [ 1 ]), # chEnvAmbientTemp
+ "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"),
+ "group" : "hw_single_temperature",
+}
+
diff --git a/pnp-templates/check_mk-enterasys_temp.php b/pnp-templates/check_mk-enterasys_temp.php
new file mode 120000
index 0000000..ee5de5e
--- /dev/null
+++ b/pnp-templates/check_mk-enterasys_temp.php
@@ -0,0 +1 @@
+check_mk-brocade_mlx_temp.php
\ No newline at end of file
diff --git a/web/plugins/perfometer/check_mk.py b/web/plugins/perfometer/check_mk.py
index 9e77b8c..186cf9c 100644
--- a/web/plugins/perfometer/check_mk.py
+++ b/web/plugins/perfometer/check_mk.py
@@ -289,6 +289,7 @@ perfometers["check_mk-innovaphone_temp"] = perfometer_temperature
perfometers["check_mk-cmciii.temp"] = perfometer_temperature
perfometers["check_mk-ibm_svc_enclosurestats.temp"] = perfometer_temperature
perfometers["check_mk-wagner_titanus_topsense.temp"] = perfometer_temperature
+perfometers["check_mk-enterasys_temp"] = perfometer_temperature
def perfometer_temperature_multi(row, check_command, perf_data):
display_value = -1