Module: check_mk
Branch: master
Commit: f51b72fca9227a4b9c1089ce0b264c632fd86fc1
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f51b72fca9227a…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Fri Aug 10 12:21:18 2012 +0200
Added new check for masterguard battery temperature
---
ChangeLog | 1 +
checkman/masterguard_bat_temp | 29 +++++++++++++++++++++
checks/masterguard_bat_temp | 56 +++++++++++++++++++++++++++++++++++++++++
3 files changed, 86 insertions(+), 0 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index a7569e6..aae0f8b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -42,6 +42,7 @@
* windows_multipath: Added the missing check for multipath.vbs (Please test)
* carel_uniflair_cooling: new check for monitoring datacenter air conditioning by
"CAREL"
* Added Agent for OpenBSD
+ * Added Checks for MasterGuard UPS devices
WATO:
* Added permission to control the "clone host" feature in WATO
diff --git a/checkman/masterguard_bat_temp b/checkman/masterguard_bat_temp
new file mode 100644
index 0000000..c37c34f
--- /dev/null
+++ b/checkman/masterguard_bat_temp
@@ -0,0 +1,29 @@
+title: Check temperature sensor on a Mastergurad UPS Device
+agents: snmp
+author: Bastian Kuhn <bk(a)mathias-kettner.de>
+license: GPL
+distribution: check_mk
+description:
+ This check monitors the state of temperature sensors
+ on Emmerson Masterguard UPS devices.
+
+
+item:
+ The description of the sensor as provided by
+ the device.
+
+perfdata:
+ The actual temperature in degree
+
+inventory:
+ One check for each sensor is created by the inventory
+
+[parameters]
+parameters (tuple): A pair of numbers for warning and critical level
+
+ warning (int): The temperature that triggers an WARNING state
+
+ critical (int): The temperature that triggers an WARNING state
+
+[configuration]
+masterguard_bat_temp_default (tuple): Default warning and critical level
diff --git a/checks/masterguard_bat_temp b/checks/masterguard_bat_temp
new file mode 100644
index 0000000..8dd5b7b
--- /dev/null
+++ b/checks/masterguard_bat_temp
@@ -0,0 +1,56 @@
+#!/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.
+
+
+masterguard_bat_temp_default = (40, 50) # warning / critical
+
+
+def check_masterguard_bat_temp(item, params, info):
+ warn, crit = params
+ for line in info:
+ if line[0] == item:
+ power = int(line[1])
+ perfdata = [ ( "temp", power, warn, crit, 80 ) ]
+ infotext = " - current: %d°C , (warn/crit at %d°C/%d°C) " % \
+ (power, warn, crit)
+
+ if power >= crit:
+ return (2, "CRIT" + infotext, perfdata)
+ elif power >= warn:
+ return (1, "WARN" + infotext, perfdata)
+ else:
+ return (0, "OK" + infotext, perfdata)
+
+ return (3, "UNKNOWN - Temperatur %s not found in SNMP output" % item)
+
+check_info['masterguard_bat_temp'] = {
+ "inventory_function" : lambda info: [ ( x[0],
"masterguard_bat_temp_default") for x in info ],
+ "check_function" : check_masterguard_bat_temp,
+ "service_description" : "Battery Temp",
+ "has_perfdata" : True,
+ "group" : "hw_temperature",
+ "snmp_info" : ( ".1.3.6.1.2.1.33.1", ["1.5",
"2.7" ] )
+}