Module: check_mk
Branch: master
Commit: 68df08c0ca3b46b8c67a9e16f804b1c872493ade
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=68df08c0ca3b46…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Wed Jul 11 15:41:55 2012 +0200
Added blade_bx_temp Check
---
checks/blade_bx_temp | 73 ++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 73 insertions(+), 0 deletions(-)
diff --git a/checks/blade_bx_temp b/checks/blade_bx_temp
new file mode 100644
index 0000000..1c3e4d6
--- /dev/null
+++ b/checks/blade_bx_temp
@@ -0,0 +1,73 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2012 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.
+
+
+def check_blade_bx_temp(item, no_params, info):
+ blade_bx_status = { 1 : "unknow",
+ 2 : "sensor-disabled",
+ 3 : "ok",
+ 4 : "sensor-faild",
+ 5 : "warning-temp",
+ 6 : "critical-temp",
+ 7 : "not-available" }
+ unit = "°C"
+ for index, status, descr, level_warn, level_crit, temp, crit_react in info:
+ status = saveint(status)
+ if descr != item: continue
+ max_temp = int(level_crit) + (int(level_crit) * 15 /100) #
critical + 15%
+ perfdata=[ ('temp', temp, level_warn, level_crit, "0", max_temp
) ]
+
+ if crit_react != "2":
+ return (2, "CRIT - Temperature not present or poweroff", perfdata)
+ elif status != 3:
+ return (2, "CRIT - Status is %s" % blade_bx_status.get(status,1) ,
perfdata)
+ elif temp >= level_crit:
+ return (2, "CRIT - Temperature at %s%s " % (temp, unit), perfdata)
+ elif temp >= level_warn:
+ return (1, "WARNING - Temperature at %s%s " % (temp,unit),
perfdata)
+ else:
+ return (0, "OK - Temperature at %s%s " % (temp,unit), perfdata)
+ return (3, "UNKNOWN - Device %s not found in SNMP data %s " % (item,
perfdata ) )
+
+ return (3, "UNKNOWN - Device %s not found in SNMP data" % item)
+
+check_info['blade_bx_temp'] = {
+ "check_function" : check_blade_bx_temp,
+ "inventory_function" : lambda info: [ (line[2], None) for line in info if
int(line[1]) != 7] ,
+ "service_description" : "Blade Temp %s",
+ "has_perfdata" : True,
+ "snmp_info" : (".1.3.6.1.4.1.7244.1.1.1.3.4.1.1", [
+ 1, # index
+ 2, # status
+ 3, # desc
+ 4, # level warn
+ 5, # level crit
+ 6, # temp
+ 7, # crit react
+ ]),
+ "snmp_scan_function" : lambda oid: "BX600" in
oid(".1.3.6.1.2.1.1.1.0"),
+}
+