Module: check_mk
Branch: master
Commit: a730f5fa0620b278fe9a739db2b523036d8e920e
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=a730f5fa0620b2…
Author: Bernd Stroessenreuther <bs(a)mathias-kettner.de>
Date: Fri Jul 18 14:23:46 2014 +0200
qlogic_sanbox.temp: New Check for temperature sensors in QLogic SANbox Fibre Channel
Switches
---
.werks/1000 | 8 +++
ChangeLog | 3 +-
checkman/qlogic_sanbox.temp | 22 +++++++
checks/qlogic_sanbox | 86 +++++++++++++++++++++++++
modules/catalog.py | 1 +
pnp-templates/check_mk-qlogic_sanbox.temp.php | 1 +
web/plugins/perfometer/check_mk.py | 1 +
7 files changed, 121 insertions(+), 1 deletion(-)
diff --git a/.werks/1000 b/.werks/1000
new file mode 100644
index 0000000..7bdeb7b
--- /dev/null
+++ b/.werks/1000
@@ -0,0 +1,8 @@
+Title: qlogic_sanbox.temp: New Check for temperature sensors in QLogic SANbox Fibre
Channel Switches
+Level: 1
+Component: checks
+Version: 1.2.5i5
+Date: 1405686184
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index 7789b6d..b7f8f89 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -29,8 +29,9 @@
* 0179 check_dns: It is now possible to use the local dns server in wato
configuration...
* 1058 livedump-mail-fetch: Now supporting either quoted-printable or non encoded
mails...
* 0180 sap: It is now possible to add multiple sap instances to the sap.cfg file...
- * 0637 jolokia_metrics.gc, jolokia_metrics.tp, jolokia_info: two new subchecks for
the jolokia_metrics checks and better error handling for jolokia_info...
* 0181 citrix_sessions, citrix_serverload: New checks for Citrix Load (a Score
calculated by citrix) and the number of sessions
+ * 0637 jolokia_metrics.gc, jolokia_metrics.tp, jolokia_info: two new subchecks for
the jolokia_metrics checks and better error handling for jolokia_info...
+ * 1000 qlogic_sanbox.temp: New Check for temperature sensors in QLogic SANbox Fibre
Channel Switches
* 0994 FIX: agent plugin smart: fixed syntax error
* 0989 FIX: logwatch.ec: Fix forwarding multiple messages via syslog/TCP...
* 0943 FIX: if.include: fixed incorrect traffic percentage values in the check output
of if checks...
diff --git a/checkman/qlogic_sanbox.temp b/checkman/qlogic_sanbox.temp
new file mode 100644
index 0000000..a82d1c2
--- /dev/null
+++ b/checkman/qlogic_sanbox.temp
@@ -0,0 +1,22 @@
+title: QLogic SANbox Fibre Channel Switches: Temperatur Sensors
+agents: snmp
+catalog: hw/storagehw/qlogic
+license: GPL
+distribution: check_mk
+description:
+ Checks the temperature sensors in QLogic SANbox Fibre Channel Switches.
+
+ The current temperature in degree celsius is displayed.
+
+ The check returns {OK} if connUnitSensorStatus reports "ok", {WARN} on
+ "warning", {CRIT} on status "failed" and {UNKN} on every other.
+
+item:
+ The ID of the sensor taken from SNMP. It contains 3 numbers separated by
+ dots, e. g. 129.45.3
+
+perfdata:
+ Exactly one value: The temperature in degree celsius.
+
+inventory:
+ Creates one check for every temperature sensor found by SNMP.
diff --git a/checks/qlogic_sanbox b/checks/qlogic_sanbox
new file mode 100644
index 0000000..d71eba3
--- /dev/null
+++ b/checks/qlogic_sanbox
@@ -0,0 +1,86 @@
+#!/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.
+
+qlogic_sanbox_temp_status_map = [ "undefined", # 0
+ "unknown", # 1
+ "other", # 2
+ "ok", # 3
+ "warning", # 4
+ "failed", ] # 5
+
+def inventory_qlogic_sanbox_temp(info):
+ inventory = []
+ for sensor_name, sensor_status, sensor_message, sensor_type, \
+ sensor_characteristic, sensor_id in info:
+ sensor_id = sensor_id.replace("16.0.0.192.221.48.",
"").replace(".0.0.0.0.0.0.0.0", "")
+ if sensor_type == "8" and sensor_characteristic == "3" and \
+ sensor_name != "Temperature Status":
+ inventory.append( (sensor_id, None) )
+ return inventory
+
+def check_qlogic_sanbox_temp(item, _no_params, info):
+ for sensor_name, sensor_status, sensor_message, sensor_type, \
+ sensor_characteristic, sensor_id in info:
+ sensor_id = sensor_id.replace("16.0.0.192.221.48.",
"").replace(".0.0.0.0.0.0.0.0", "")
+ if sensor_id == item:
+ sensor_status = int(sensor_status)
+ if sensor_status < 0 or sensor_status >=
len(qlogic_sanbox_temp_status_map):
+ sensor_status_descr = sensor_status
+ else:
+ sensor_status_descr = qlogic_sanbox_temp_status_map[int(sensor_status)]
+
+ if sensor_status == 3:
+ status = 0
+ elif sensor_status == 4:
+ status = 1
+ elif sensor_status == 5:
+ status = 2
+ else:
+ status = 3
+
+ if sensor_message.endswith(" degrees C"):
+ temp = int(sensor_message.replace(" degrees C", ""))
+ perfdata = [ ('temp', str(temp) + 'C') ]
+ else:
+ perfdata = []
+
+ return status, "Sensor %s is at %s and reports status %s" % \
+ (sensor_id, sensor_message, sensor_status_descr), perfdata
+ return 3, "No sensor %s found" % item
+
+check_info["qlogic_sanbox.temp"] = {
+ "check_function" : check_qlogic_sanbox_temp,
+ "inventory_function" : inventory_qlogic_sanbox_temp,
+ "service_description" : "Temperature Sensor %s",
+ "has_perfdata" : True,
+ "snmp_info" : (".1.3.6.1.3.94.1.8.1", [3, #
connUnitSensorName
+ 4, # connUnitSensorStatus
+ 6, # connUnitSensorMessage
+ 7, # connUnitSensorType
+ 8, # connUnitSensorCharacteristic
+ OID_END]),
+ "snmp_scan_function" : lambda oid:
oid(".1.3.6.1.2.1.1.2.0").startswith(".1.3.6.1.4.1.3873.1.14"),
+}
diff --git a/modules/catalog.py b/modules/catalog.py
index 376547e..6c5dcfb 100644
--- a/modules/catalog.py
+++ b/modules/catalog.py
@@ -53,6 +53,7 @@ manpage_catalog_titles = {
"netapp" : "NetApp",
"hitachi" : "Hitachi",
"emc" : "EMC",
+ "qlogic" : "QLogic",
"phone" : "Telephony",
"app" : "Applications",
diff --git a/pnp-templates/check_mk-qlogic_sanbox.temp.php
b/pnp-templates/check_mk-qlogic_sanbox.temp.php
new file mode 120000
index 0000000..23897c1
--- /dev/null
+++ b/pnp-templates/check_mk-qlogic_sanbox.temp.php
@@ -0,0 +1 @@
+check_mk-hitachi_hnas_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 ad428c7..25f76f6 100644
--- a/web/plugins/perfometer/check_mk.py
+++ b/web/plugins/perfometer/check_mk.py
@@ -338,6 +338,7 @@ perfometers["check_mk-wagner_titanus_topsense.temp"] =
perfometer_temperature
perfometers["check_mk-enterasys_temp"] = perfometer_temperature
perfometers["check_mk-adva_fsp_temp"] = perfometer_temperature
perfometers["check_mk-allnet_ip_sensoric.temp"] = perfometer_temperature
+perfometers["check_mk-qlogic_sanbox.temp"] = perfometer_temperature
def perfometer_temperature_multi(row, check_command, perf_data):
display_value = -1