Module: check_mk
Branch: master
Commit: df33bf24cb499101f83bf9fbf38867dd481b2d87
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=df33bf24cb4991…
Author: Konstantin Büttner <kb(a)mathias-kettner.de>
Date: Thu Feb 19 17:25:28 2015 +0100
#1889 cmciii.phase: New check to monitor input phases for Raritan PDUs
---
.werks/1889 | 9 +++++++
ChangeLog | 1 +
checkman/cmciii.phase | 30 ++++++++++++++++++++++
checks/cmciii | 54 +++++++++++++++++++++++++++++++++++++++
web/plugins/metrics/check_mk.py | 1 +
5 files changed, 95 insertions(+)
diff --git a/.werks/1889 b/.werks/1889
new file mode 100644
index 0000000..ca03c5d
--- /dev/null
+++ b/.werks/1889
@@ -0,0 +1,9 @@
+Title: cmciii.phase: New check to monitor input phases for Raritan PDUs
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i1
+Date: 1424363018
+Class: feature
+
+
diff --git a/ChangeLog b/ChangeLog
index 1611c0e..0332c5d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -86,6 +86,7 @@
* 1996 kernel.util: Also output values for steal and guest (no PNP template yet)
* 1998 statgrab_net: New implementation of network interface monitoring via
statgrab...
NOTE: Please refer to the migration notes!
+ * 1889 cmciii.phase: New check to monitor input phases for Raritan PDUs
* 1457 FIX: logins: new check renamed from "users" check...
NOTE: Please refer to the migration notes!
* 1762 FIX: lnx_thermal: Now ignoring trip points with level 0...
diff --git a/checkman/cmciii.phase b/checkman/cmciii.phase
new file mode 100644
index 0000000..8602f06
--- /dev/null
+++ b/checkman/cmciii.phase
@@ -0,0 +1,30 @@
+title: Rittal CMC-III PDUs: Input Phases
+agents: snmp
+catalog: hw/power/rittal
+license: GPL
+distribution: check_mk
+description:
+ This check monitors the input power phases for Rittal CMC-III PDUs.
+
+item:
+ The unit name and the phase identifier ("Phase 1"), or Summary for overall
+ power and energy.
+
+perfdata:
+ Voltage in Volt, power in Watt, current in Ampère, energy in Wh, apparent power in VA.
+ Only Power and Energy for the summary Item.
+
+inventory:
+ One item per phase and one summary item is added.
+
+[parameters]
+parameters (dict): This check supports four types of parameters,
+none of which have default values. It is a dictionary with the following keys:
+
+ {"voltage"}: Warning and critical levels for voltage in int, denoting the
minimum required voltage in volt.
+
+ {"current"}: Warning and critical levels for current in int, denoted in
Ampère
+
+ {"power"}: Warning and critical levels for power in int, denoted in Watt.
+
+ {"appower"}: Warning and critical levels for apparent power in int, denoted in
AV.
diff --git a/checks/cmciii b/checks/cmciii
index 39a5050..0e69e09 100644
--- a/checks/cmciii
+++ b/checks/cmciii
@@ -728,3 +728,57 @@ check_info['cmciii.humidity'] = {
"has_perfdata" : True,
}
#.
+# .--phase---------------------------------------------------------------.
+# | _ |
+# | _ __ | |__ __ _ ___ ___ |
+# | | '_ \| '_ \ / _` / __|/ _ \ |
+# | | |_) | | | | (_| \__ \ __/ |
+# | | .__/|_| |_|\__,_|___/\___| |
+# | |_| |
+# +----------------------------------------------------------------------+
+# | |
+# '----------------------------------------------------------------------'
+
+def inventory_cmciii_phase(info):
+ phases = {}
+ parsed = parse_cmciii_inputs(info[0])
+ units = parse_units(info[1])
+ for (unit, raw_item_name), entry in parsed.iteritems():
+ unit_type, unit_name = units[int(unit)-1][0:2]
+ if 'Phase' in raw_item_name:
+ item_name = raw_item_name.split(".")[1]
+ phases["%s Phase %s" % (unit_name, item_name[-1])] = {}
+ elif 'Unit.General' in raw_item_name:
+ phases["%s Summary" % unit_name] = {}
+ return phases.items()
+
+def check_cmciii_phase(item, params, info):
+ unit_name = item.split(" ")[0]
+ item_name = item.split(" ")[-1]
+ semiparsed = parse_cmciii_inputs(info[0])
+ unit = get_unit_number(parse_units(info[1]), unit_name)
+ parsed = {}
+ parsed[item] = {}
+ if "Phase" in item:
+ parsed[item]["voltage"] = float(semiparsed[(unit,
"Unit.Phase" + item_name +
".Voltage")]["Value"].split()[0]), None
+ parsed[item]["current"] = float(semiparsed[(unit,
"Unit.Phase" + item_name +
".Current")]["Value"].split()[0]), None
+ parsed[item]["power"] = float(semiparsed[(unit,
"Unit.Phase" + item_name +
".Power.Active")]["Value"].split()[0]), None
+ parsed[item]["appower"] = float(semiparsed[(unit,
"Unit.Phase" + item_name +
".Power.Apparent")]["Value"].split()[0]), None
+ parsed[item]["energy"] = float(semiparsed[(unit,
"Unit.Phase" + item_name +
".Energy.Active")]["Value"].split()[0]), None
+ elif "Summary" in item:
+ parsed[item]["power"] = float(semiparsed[(unit,
"Unit.General.Power")]["Value"].split()[0]), None
+ parsed[item]["energy"] = float(semiparsed[(unit,
"Unit.General.Energy.Active")]["Value"].split()[0]), None
+
+ return check_elphase(item, params, parsed)
+
+check_info['cmciii.phase'] = {
+ "check_function" : check_cmciii_phase,
+ "inventory_function" : inventory_cmciii_phase,
+ "service_description" : "Input %s",
+ "has_perfdata" : True,
+ "snmp_scan_function" : cmciii_scan,
+ "snmp_info" : cmciii_snmp_info,
+ "includes" : [ "elphase.include" ],
+ "group" : "el_inphase",
+}
+#.
diff --git a/web/plugins/metrics/check_mk.py b/web/plugins/metrics/check_mk.py
index 46dba9c..8cd1b1d 100644
--- a/web/plugins/metrics/check_mk.py
+++ b/web/plugins/metrics/check_mk.py
@@ -416,6 +416,7 @@ check_metrics["check_mk-sensatronics_temp"]
= {}
check_metrics["check_mk-smart.temp"] = {}
check_metrics["check_mk-viprinet_temp"] = {}
check_metrics["check_mk-wagner_titanus_topsense.temp"] = {}
+check_metrics["check_mk-cmciii.phase"] = {}
check_metrics["check_mk-kernel"] = {
"processes" : { "name" : "proc_creat", } }