Door in raritan_emx
Message-ID: <55f6ea02.hwLJlVqXsHy+aPSW%si(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: afeced2195b8feb2dea6c062c5a6cac6ea05860a
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=afeced2195b8fe…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Mon Sep 14 17:38:35 2015 +0200
replaces service description Binary -> Door in raritan_emx
---
checks/raritan_emx | 32 ++++++++++++++++++++------------
1 file changed, 20 insertions(+), 12 deletions(-)
diff --git a/checks/raritan_emx b/checks/raritan_emx
index 6673a21..2a7da88 100644
--- a/checks/raritan_emx
+++ b/checks/raritan_emx
@@ -24,9 +24,6 @@
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301 USA.
-# TODO:
-# "Binary Rack 1 DC" --> "Door Rack 1" open/closed
-# Temperatur parametrierbar
def parse_raritan_emx(info):
raritan_map_type = {
@@ -44,7 +41,7 @@ def parse_raritan_emx(info):
if rack_type_readable != '':
extra_name += " " + rack_type_readable
- rack_name = ("Rack %s%s %s" % (rack_id, extra_name,
rack_name)).strip()
+ rack_name = ("Rack %s%s %s" % (rack_id, extra_name,
rack_name)).replace("DC", "").strip()
if rack_type in [ 'binary', '' ]:
rack_value = None
@@ -69,6 +66,7 @@ def inventory_raritan_emx(parsed, rack_type):
if values["rack_type"] == rack_type:
yield rack_name, None
+
# .--temperature---------------------------------------------------------.
# | _ _ |
# | | |_ ___ _ __ ___ _ __ ___ _ __ __ _| |_ _ _ _ __ ___ |
@@ -80,18 +78,26 @@ def inventory_raritan_emx(parsed, rack_type):
# | main check |
# '----------------------------------------------------------------------'
-def check_raritan_emx_temp(item, _no_params, parsed):
+
+def inventory_raritan_emx_temp(parsed):
+ for rack_name, values in parsed.items():
+ if values["rack_type"] == "temp":
+ yield rack_name, {}
+
+
+def check_raritan_emx_temp(item, params, parsed):
if item in parsed:
rack_value = parsed[item]["rack_value"]
rack_unit = parsed[item]["rack_unit"]
state, state_readable = parsed[item]["state"]
- return check_temperature(rack_value, params=None, dev_unit=rack_unit,
- dev_status = state, dev_status_name = state_readable)
+ return check_temperature(rack_value, params,
+ dev_unit=rack_unit, dev_status = state,
+ dev_status_name = state_readable)
check_info['raritan_emx'] = {
"parse_function" : parse_raritan_emx,
- "inventory_function" : lambda parsed: inventory_raritan_emx(parsed,
"temp"),
+ "inventory_function" : inventory_raritan_emx_temp,
"check_function" : check_raritan_emx_temp,
"service_description" : "Temperature %s",
"has_perfdata" : True,
@@ -104,6 +110,7 @@ check_info['raritan_emx'] = {
"2.1.1.2", # State
]),
"snmp_scan_function" : lambda oid: oid(".1.3.6.1.2.1.1.2.0")
in [".1.3.6.1.4.1.13742.8"],
+ "group" : "temperature",
"includes" : [ "temperature.includes",
"raritan.include" ],
}
@@ -117,6 +124,7 @@ check_info['raritan_emx'] = {
# | |
# '----------------------------------------------------------------------'
+
def check_raritan_emx_fan(item, _no_params, parsed):
if item in parsed:
fan_speed = parsed[item]["rack_value"]
@@ -126,9 +134,9 @@ def check_raritan_emx_fan(item, _no_params, parsed):
check_info['raritan_emx.fan'] = {
- "inventory_function" : lambda parsed: inventory_raritan_emx(parsed,
"fanspeed"),
- "check_function" : check_raritan_emx_fan,
- "service_description" : "Fan %s",
+ "inventory_function" : lambda parsed: inventory_raritan_emx(parsed,
"fanspeed"),
+ "check_function" : check_raritan_emx_fan,
+ "service_description" : "Fan %s",
}
#.
@@ -144,5 +152,5 @@ check_info['raritan_emx.fan'] = {
check_info['raritan_emx.binary'] = {
"inventory_function" : lambda parsed: inventory_raritan_emx(parsed,
"binary"),
"check_function" : check_raritan_sensors_binary,
- "service_description" : "Binary %s",
+ "service_description" : "Door %s",
}