Module: check_mk
Branch: master
Commit: 07edb17438c002835f70114d34b1ddf6df7a0835
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=07edb17438c002…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Mon Jul 27 11:32:24 2015 +0200
new check hp_procurve_temp
---
checkman/hp_procurve_temp | 20 ++++++++++++++++
checks/hp_procurve_temp | 57 +++++++++++++++++++++++++++++++++++++++++++++
2 files changed, 77 insertions(+)
diff --git a/checkman/hp_procurve_temp b/checkman/hp_procurve_temp
new file mode 100644
index 0000000..62c500e
--- /dev/null
+++ b/checkman/hp_procurve_temp
@@ -0,0 +1,20 @@
+title: HP Switches: System Temperature
+agents: snmp
+catalog: hw/network/hp
+license: GPL
+distribution: check_mk
+description:
+ This check monitors the system temperature of HP Switches which support
+ the HP-ICF-CHASSIS-MIB.
+ No default levels are set.
+
+ Upper or lower levels can be configured.
+
+item:
+ The system name of the switch.
+
+perfdata:
+ One variable: the system temperature in celsius.
+
+inventory:
+ One service is created for the system temperature.
diff --git a/checks/hp_procurve_temp b/checks/hp_procurve_temp
new file mode 100644
index 0000000..4b8aed9
--- /dev/null
+++ b/checks/hp_procurve_temp
@@ -0,0 +1,57 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2015 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.
+
+
+# .1.3.6.1.4.1.11.2.14.11.1.2.8.1.1.2.0 Sys-1 # system name
+# .1.3.6.1.4.1.11.2.14.11.1.2.8.1.1.3.0 21C # current temperature
+# .1.3.6.1.4.1.11.2.14.11.1.2.8.1.1.4.0 22C # maximum temperature
+# .1.3.6.1.4.1.11.2.14.11.1.2.8.1.1.5.0 18C # minimum temperature
+# .1.3.6.1.4.1.11.2.14.11.1.2.8.1.1.6.0 2 # Over temperature
+# .1.3.6.1.4.1.11.2.14.11.1.2.8.1.1.7.0 57C # temperature threshold
+# .1.3.6.1.4.1.11.2.14.11.1.2.8.1.1.9.0 17 # average temperature
+
+
+def inventory_hp_procurve_temp(info):
+ if len(info) == 1:
+ return [ (info[0][0], {}) ]
+
+
+def check_hp_procurve_temp(item, params, info):
+ if len(info) == 1:
+ temp, dev_unit = int(info[0][1][:-1]), info[0][1][-1].lower()
+ return check_temperature(temp, params, dev_unit)
+
+
+check_info['hp_procurve_temp'] = {
+ 'inventory_function' : inventory_hp_procurve_temp,
+ 'check_function' : check_hp_procurve_temp,
+ 'service_description' : 'Temperature %s',
+ 'has_perfdata' : True,
+ 'group' : 'temperature',
+ 'snmp_info' : (
".1.3.6.1.4.1.11.2.14.11.1.2.8.1.1", [ "2", "3" ] ),
+ 'snmp_scan_function' : lambda oid:
oid(".1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.4.1.11.2.3.7.11"),
+ 'includes' : [ 'temperature.include' ],
+}