Module: check_mk
Branch: master
Commit: 5269bd44069544ffa000574e638d0a3f71dbf302
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=5269bd44069544…
Author: Bernd Stroessenreuther <bs(a)mathias-kettner.de>
Date: Wed Jan 22 19:02:59 2014 +0100
stulz_pump: new check for the status of pumps of Stulz clima units
---
.werks/464 | 8 ++++++++
ChangeLog | 1 +
checkman/stulz_pump | 11 +++++++++++
checks/stulz_pump | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 73 insertions(+)
diff --git a/.werks/464 b/.werks/464
new file mode 100644
index 0000000..eb9e1f0
--- /dev/null
+++ b/.werks/464
@@ -0,0 +1,8 @@
+Title: stulz_pump: new check for the status of pumps of Stulz clima units
+Level: 1
+Component: checks
+Version: 1.2.5i1
+Date: 1390413752
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index 4d496fd..25d3ce9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -59,6 +59,7 @@
* 0462 emcvnx_raidgroups.list_disks: New check for EMC VNX storage system...
* 0463 emcvnx_raidgroups.capacity, emcvnx_raidgroups.capacity_contiguous: New Checks
for EMC VNX Storage systems...
* 0570 fileinfo.groups: file groups now allow exclude patterns as well
+ * 0464 stulz_pump: new check for the status of pumps of Stulz clima units
* 0103 FIX: services: Fixed bug with service inventory defined in main.mk...
* 0299 FIX: borcade_mlx_fan: Prettified output, handling "other" state now
* 0300 FIX: cisco_fru_power: Trying not to inventorize not plugged in FRUs...
diff --git a/checkman/stulz_pump b/checkman/stulz_pump
new file mode 100644
index 0000000..c1435b8
--- /dev/null
+++ b/checkman/stulz_pump
@@ -0,0 +1,11 @@
+title: Stulz clima unit pump status
+agents: snmp
+catalog: hw/environment
+license: GPL
+distribution: check_mk
+description:
+ This plugin checks the status of pumps of Stulz clima units. Returns
+ {OK} if the pump is running and {CRIT} if it is not running.
+
+inventory:
+ The inventory will create exactly one service per pump.
diff --git a/checks/stulz_pump b/checks/stulz_pump
new file mode 100644
index 0000000..e3e6ec2
--- /dev/null
+++ b/checks/stulz_pump
@@ -0,0 +1,53 @@
+#!/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.
+
+def inventory_stulz_pump(info):
+ inventory = []
+ for pump_id, pump_status in info:
+ pump_id = pump_id.replace('.1', '')
+ inventory.append( (pump_id, None) )
+ return inventory
+
+def check_stulz_pump(item, _no_params, info):
+ for pump_id, pump_status in info:
+ pump_id = pump_id.replace('.1', '')
+ if pump_id == item:
+ if pump_status == '1':
+ return 0, "Pump is running"
+ elif pump_status == '0':
+ return 2, "Pump is not running"
+ else:
+ return 3, "Pump reports unidentified status " + pump_status
+ return 3, "Pump %s not found" % item
+
+check_info["stulz_pump"] = {
+ "check_function" : check_stulz_pump,
+ "inventory_function" : inventory_stulz_pump,
+ "service_description" : "Pump %s",
+ "snmp_scan_function" : lambda oid: oid(".1.3.6.1.2.1.1.2.0")
== ".1.3.6.1.4.1.29462.10",
+ "snmp_info" : (
".1.3.6.1.4.1.29462.10.2.1.1.2.1.4.1.1.5802", [ OID_END, 2] ),
+}
+