Module: check_mk
Branch: master
Commit: 87c2659c78a40f1565a7ab0d4320fe924daf0449
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=87c2659c78a40f…
Author: Sebastian Herbord <sh(a)mathias-kettner.de>
Date: Tue Nov 17 10:15:52 2015 +0100
#2711 janitza_umg: added support for umg508
The umg508 uses the identical mib to umg604 so no functional changes were necessary.
In the same process the device identification was improved.
---
.werks/2711 | 10 ++++++++++
ChangeLog | 1 +
checkman/janitza_umg | 4 ++--
checks/janitza_umg | 30 +++++++++++++++++++-----------
4 files changed, 32 insertions(+), 13 deletions(-)
diff --git a/.werks/2711 b/.werks/2711
new file mode 100644
index 0000000..bdb3b2b
--- /dev/null
+++ b/.werks/2711
@@ -0,0 +1,10 @@
+Title: janitza_umg: added support for umg508
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i4
+Date: 1447751629
+Class: feature
+
+The umg508 uses the identical mib to umg604 so no functional changes were necessary.
+In the same process the device identification was improved.
diff --git a/ChangeLog b/ChangeLog
index 0150070..a458e7a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -32,6 +32,7 @@
* 2833 isc_dhcpd, win_dhcp_pools: lower levels for used dhcp leases are now
configurable...
* 2789 netapp_api_snapvault: No longer monitors uninitialized volumes...
* 2710 arbor_peakflow_sp, arbor_peakflow_sp.cpu_load, arbor_peakflow_sp.disk_usage,
arbor_peakflow_sp.flows, arbor_peakflow_tms, arbor_peakflow_tms.cpu_load,
arbor_peakflow_tms.disk_usage, arbor_peakflow_tms.host_fault, arbor_peakflow_tms.updates,
arbor_pravail, arbor_pravail.cpu_load, arbor_pravail.disk_usage, arbor_pravail.host_fault:
new checks for various arbor devices
+ * 2711 janitza_umg: added support for umg508...
* 2660 FIX: fixed windows agent using the wrong working directory...
* 2664 FIX: ps: Speedup in situation with many matching processes...
* 2661 FIX: windows agent: fixed incomplete process list...
diff --git a/checkman/janitza_umg b/checkman/janitza_umg
index 8588f58..bceebdf 100644
--- a/checkman/janitza_umg
+++ b/checkman/janitza_umg
@@ -5,8 +5,8 @@ license: GPL
distribution: check_mk
description:
Monitors voltage, current, power, apparent power and energy on Janitza Power
- Analyzers. This currently supports the devices UMG 604 and UMG 96 though others
- from the same line may be very similar.
+ Analyzers. This currently supports the devices UMG 604, UMG 508 and UMG 96
+ though others from the same line may be very similar.
item:
The identifier of the phase ({"Phase 1"}, {"Phase 2"}, {"Phase
3"}).
diff --git a/checks/janitza_umg b/checks/janitza_umg
index 2830bdf..8faaedf 100644
--- a/checks/janitza_umg
+++ b/checks/janitza_umg
@@ -25,19 +25,26 @@
# Boston, MA 02110-1301 USA.
+# 508 and 604 have the same mib
+janitza_umg_device_map = {
+ ".1.3.6.1.4.1.34278.8.6" : "96",
+ ".1.3.6.1.4.1.34278.10.1" : "604",
+ ".1.3.6.1.4.1.34278.10.4" : "508",
+}
+
+
def parse_janitza_umg_inphase(info):
def flatten(line):
return [x[0] for x in line]
- if "604" in info[0][0][0]:
- dev_type = "604"
- elif "96" in info[0][0][0]:
- dev_type = "96"
- else:
- # unrecognized device
- return {}
+ dev_type = janitza_umg_device_map[info[0][0][0]]
info_offsets = {
+ "508" : {
+ "energy": 4,
+ "sumenergy": 5,
+ "misc": 8,
+ },
"604" : {
"energy": 4,
"sumenergy": 5,
@@ -55,7 +62,7 @@ def parse_janitza_umg_inphase(info):
energy = flatten(info[info_offsets["energy"]])
sumenergy = flatten(info[info_offsets["sumenergy"]])
- if dev_type == "604":
+ if dev_type in ["508", "604"]:
num_phases = 4
num_currents = 4
elif dev_type == "96":
@@ -98,6 +105,7 @@ def parse_janitza_umg_inphase(info):
misc = flatten(info[info_offsets["misc"]])
result["Frequency"] = int(misc[0])
+ # temperature not present in UMG508 and UMG604
if len(misc) > 1:
result["Temperature"] = map(int, misc[1:])
else:
@@ -121,7 +129,7 @@ check_info['janitza_umg'] = {
'includes' : [ "elphase.include", ],
'group' : 'el_inphase',
'snmp_info' : [
- (".1.3.6.1.2.1.1", [ "5" ]),
# device id
+ (".1.3.6.1.2.1.1.2", [ "0" ]),
# device id
(".1.3.6.1.4.1.34278", [ "1" ]),
# rmsPhase
(".1.3.6.1.4.1.34278", [ "2" ]),
# rmsSum
(".1.3.6.1.4.1.34278", [ "3" ]),
# device dependent
@@ -131,8 +139,8 @@ check_info['janitza_umg'] = {
(".1.3.6.1.4.1.34278", [ "7" ]),
# "
(".1.3.6.1.4.1.34278", [ "8" ]),
# "
],
- 'snmp_scan_function' : lambda oid: oid(".1.3.6.1.2.1.1.2.0")
in [".1.3.6.1.4.1.34278.8.6",
-
".1.3.6.1.4.1.34278.10.1"]
+ 'snmp_scan_function' : lambda oid: oid(".1.3.6.1.2.1.1.2.0")
in
+ janitza_umg_device_map.keys()
}