New checks for the Omnitronics IPR400
Message-ID: <55e5a190.JK5K+K84sntFtwSZ%sh(a)mathias-kettner.de>
User-Agent: Heirloom mailx 12.5 6/20/10
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Module: check_mk
Branch: master
Commit: ba087dc9ed3527785f75898fcfead131720f3945
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=ba087dc9ed3527…
Author: Sebastian Herbord <sh(a)mathias-kettner.de>
Date: Tue Sep 1 15:00:50 2015 +0200
#2563 ipr400_temp, ipr400_in_voltage: New checks for the Omnitronics IPR400
---
.werks/2563 | 9 +++++++
ChangeLog | 1 +
checkman/ipr400_in_voltage | 10 ++++++++
checkman/ipr400_temp | 10 ++++++++
checks/ipr400_in_voltage | 58 ++++++++++++++++++++++++++++++++++++++++++++
checks/ipr400_temp | 45 ++++++++++++++++++++++++++++++++++
6 files changed, 133 insertions(+)
diff --git a/.werks/2563 b/.werks/2563
new file mode 100644
index 0000000..6e51780
--- /dev/null
+++ b/.werks/2563
@@ -0,0 +1,9 @@
+Title: ipr400_temp, ipr400_in_voltage: New checks for the Omnitronics IPR400
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i3
+Date: 1441112436
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index 55a4275..990ff03 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -69,6 +69,7 @@
* 2424 esx_vsphere_counters: improved handling when data is missing...
* 1288 cisco_vpn_tunnel: Added Metrics for trafic, please beware:...
* 2425 agent_hp_msa: New special agent to monitor "HP MSA Storage"
devices...
+ * 2563 ipr400_temp, ipr400_in_voltage: New checks for the Omnitronics IPR400
* 2315 FIX: windows agent: BOM replacement, fixed incorrect byte offset...
* 2316 FIX: windows agent: fix garbled output of cached agent plugins...
* 2358 FIX: check_mk_agent.solaris: more correct computation of zfs used space...
diff --git a/checkman/ipr400_in_voltage b/checkman/ipr400_in_voltage
new file mode 100644
index 0000000..021424b
--- /dev/null
+++ b/checkman/ipr400_in_voltage
@@ -0,0 +1,10 @@
+title: Omnitronics IPR400 VoIP Device: Input Voltage
+agents: snmp
+catalog: hw/phone
+license: GPL
+distribution: check_mk
+description:
+ The check monitors the input voltage on Omnitronics IPR400 VoIP devices.
+
+inventory:
+ Creates exactly one service
diff --git a/checkman/ipr400_temp b/checkman/ipr400_temp
new file mode 100644
index 0000000..0ec3b0b
--- /dev/null
+++ b/checkman/ipr400_temp
@@ -0,0 +1,10 @@
+title: Omnitronics IPR400 VoIP Device: Temperature
+agents: snmp
+catalog: hw/phone
+license: GPL
+distribution: check_mk
+description:
+ The check monitors the temperature on Omnitronics IPR400 VoIP devices.
+
+inventory:
+ Creates exactly one service
diff --git a/checks/ipr400_in_voltage b/checks/ipr400_in_voltage
new file mode 100644
index 0000000..5eb878f
--- /dev/null
+++ b/checks/ipr400_in_voltage
@@ -0,0 +1,58 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2014 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.
+
+
+ipr400_in_voltage_default_levels = (12.0, 11.5) # 11.5-13.8V is the operational voltage
according
+ # to the manual
+
+def inventory_ipr400_in_voltage(info):
+ if len(info) > 0:
+ yield "1", "ipr400_in_voltage_default_levels"
+
+def check_ipr400_in_voltage(item, params, info):
+ warn, crit = params
+ power = int(info[0][0]) / 1000.0 # appears to be in mV
+ perfdata = [ ( "in_voltage", power, warn, crit ) ]
+ infotext = "in voltage: %.1fV" % power
+ limitstext = "(warn/crit below %.1fV/%.1fV)" % (warn, crit)
+
+ if power <= crit:
+ return 2, infotext + ", " + limitstext, perfdata
+ elif power <= warn:
+ return 1, infotext + ", " + limitstext, perfdata
+ else:
+ return 0, infotext, perfdata
+
+check_info["ipr400_in_voltage"] = {
+ "check_function" : check_ipr400_in_voltage,
+ "inventory_function" : inventory_ipr400_in_voltage,
+ "service_description" : "IN Voltage %s",
+ "has_perfdata" : True,
+ "group" : "evolt",
+ "snmp_scan_function" : lambda oid:
oid(".1.3.6.1.2.1.1.1.0").lower().startswith("ipr voip device
ipr400"),
+ "snmp_info" : ( ".1.3.6.1.4.1.27053.1.4.5.10", [
"0" ] ),
+}
+
diff --git a/checks/ipr400_temp b/checks/ipr400_temp
new file mode 100644
index 0000000..3c6593a
--- /dev/null
+++ b/checks/ipr400_temp
@@ -0,0 +1,45 @@
+#!/usr/bin/python
+# -*- encoding: utf-8; py-indent-offset: 4 -*-
+# +------------------------------------------------------------------+
+# | ____ _ _ __ __ _ __ |
+# | / ___| |__ ___ ___| | __ | \/ | |/ / |
+# | | | | '_ \ / _ \/ __| |/ / | |\/| | ' / |
+# | | |___| | | | __/ (__| < | | | | . \ |
+# | \____|_| |_|\___|\___|_|\_\___|_| |_|_|\_\ |
+# | |
+# | Copyright Mathias Kettner 2014 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_ipr400_temp(info):
+ if len(info) > 0:
+ yield "Ambient", None
+
+def check_ipr400_temp(item, params, info):
+ return check_temperature(int(info[0][0]), params)
+
+check_info["ipr400_temp"] = {
+ "check_function" : check_ipr400_temp,
+ "inventory_function" : inventory_ipr400_temp,
+ "service_description" : "Temperature %s ",
+ "has_perfdata" : True,
+ "group" : "temperature",
+ "snmp_scan_function" : lambda oid:
oid(".1.3.6.1.2.1.1.1.0").lower().startswith("ipr voip device
ipr400"),
+ "snmp_info" : ( ".1.3.6.1.4.1.27053.1.4.5", [ 9 ] ),
+ "includes" : [ "temperature.include" ],
+}
+