Module: check_mk
Branch: master
Commit: 11fa2a43d52b4fd4d2411c27ecd9ae3a76262b39
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=11fa2a43d52b4f…
Author: Bastian Kuhn <bk(a)mathias-kettner.de>
Date: Fri Aug 10 16:23:11 2012 +0200
Added check for masterguard out load
---
checkman/masterguard_out_load | 26 +++++++++++++++++++
checks/masterguard_out_load | 56 +++++++++++++++++++++++++++++++++++++++++
2 files changed, 82 insertions(+), 0 deletions(-)
diff --git a/checkman/masterguard_out_load b/checkman/masterguard_out_load
new file mode 100644
index 0000000..081e859
--- /dev/null
+++ b/checkman/masterguard_out_load
@@ -0,0 +1,26 @@
+title: Show the OUT load masterguard ups devices
+agents: snmp
+author: Bastian Kuhn <bk(a)mathias-kettner.de>
+license: GPL
+distribution: check_mk
+description:
+ OUT load
+
+item:
+ ID of the phase
+
+perfdata:
+ The current Load
+
+inventory:
+ One service per phase will be created
+
+[parameters]
+parameters (tuple): A pair of numbers for warning and critical level
+
+ warning (int): The lower limit which triggers an WARNING state
+
+ critical (int): The lower limit which triggers an CRITICAL state
+
+[configuration]
+masterguard_out_load_default_levels (tuple): Default warning and critical level
diff --git a/checks/masterguard_out_load b/checks/masterguard_out_load
new file mode 100644
index 0000000..bc3dc2e
--- /dev/null
+++ b/checks/masterguard_out_load
@@ -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_out_load_default_levels = (85, 90) # warning / critical
+
+
+def check_masterguard_out_load(item, params, info):
+ warn, crit = params
+ for line in info:
+ if line[0] == item:
+ power = int(line[1])
+ perfdata = [ ( "out_load", power, warn, crit, 100 ) ]
+ infotext = " - current load: %d (warn/crit at %d/%d) " % \
+ (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 - Phase %s not found in SNMP output" % item)
+
+check_info['masterguard_out_load'] = {
+ "inventory_function" : lambda info: [ ( x[0],
"masterguard_out_load_default_levels") for x in info ],
+ "check_function" : check_masterguard_out_load,
+ "service_description" : "OUT load phase %s",
+ "has_perfdata" : True,
+ "snmp_info" : ( ".1.3.6.1.2.1.33.1.4.4.1", [ 0, 5 ] ),
+ "snmp_scan_function" : lambda oid: "masterguard" in
oid('.1.3.6.1.2.1.1.1.0').lower(),
+}