Module: check_mk
Branch: master
Commit: 354f7db6610b0e1736db428e0cab9babdb70fb1a
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=354f7db6610b0e…
Author: Konstantin Büttner <kb(a)mathias-kettner.de>
Date: Mon Aug 10 15:01:06 2015 +0200
#2455 FIX raritan_pdu_inlet: Fixed scaling
Previously, the check did not take certain OIDs defining the scaling into account.
This has been fixed.
---
.werks/2455 | 11 +++++++++++
ChangeLog | 1 +
checks/raritan_pdu_inlet | 16 ++++++++++------
3 files changed, 22 insertions(+), 6 deletions(-)
diff --git a/.werks/2455 b/.werks/2455
new file mode 100644
index 0000000..75c0674
--- /dev/null
+++ b/.werks/2455
@@ -0,0 +1,11 @@
+Title: raritan_pdu_inlet: Fixed scaling
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.2.7i3
+Date: 1439211601
+
+Previously, the check did not take certain OIDs defining the scaling into account.
+This has been fixed.
diff --git a/ChangeLog b/ChangeLog
index 747bcd9..19ea05a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -108,6 +108,7 @@
* 2503 FIX: diskstat: Only excluding multipath members when infos for multipath
devices are available...
* 2504 FIX: cups_queues: Fixed wrong queue discovery on hosts running apcupsd
* 2506 FIX: Diskstat summary: Ignoring stats from LVM devices
+ * 2455 FIX: raritan_pdu_inlet: Fixed scaling...
Multisite:
* 2385 SEC: Fixed possible reflected XSS on all GUI pages where users can produce
unhandled exceptions...
diff --git a/checks/raritan_pdu_inlet b/checks/raritan_pdu_inlet
index a68f684..baefdb5 100644
--- a/checks/raritan_pdu_inlet
+++ b/checks/raritan_pdu_inlet
@@ -25,15 +25,16 @@
# Boston, MA 02110-1301 USA.
def parse_raritan_pdu_inlet(info):
+ precisions = dict([(oid_end, int(decimals)) for oid_end, decimals in info[0]])
parsed = {}
- for oid_end, availability, sensor_state, value in info:
+ for oid_end, availability, sensor_state, value in info[1]:
if availability == '1':
phase_id, sensor_type = oid_end.split('.')[2:4]
phase = "Phase " + phase_id
if int(sensor_type) in raritan_pdu_sensor_types:
parsed.setdefault(phase, {})
key = raritan_pdu_sensor_types[int(sensor_type)] # get key for
elphase.include
- value = float(value)
+ value = float(value) / 10 ** precisions[oid_end]
if sensor_state in [ '2', '6' ]:
state = 2
elif sensor_state != '4':
@@ -56,13 +57,16 @@ check_info['raritan_pdu_inlet'] = {
"service_description" : "Input %s",
"has_perfdata" : True,
"group" : "el_inphase",
- "snmp_info" : ( #".1.3.6.1.4.1.13742.6.5.2.4.1.4.1.1",
- ".1.3.6.1.4.1.13742.6.5.2.4.1",
- [ OID_END,
+ "snmp_info" : [ (".1.3.6.1.4.1.13742.6.3.3.6.1",
+ [ OID_END,
+ "7", # inletPoleSensorDecimalDigits
+ ]),
+ (".1.3.6.1.4.1.13742.6.5.2.4.1",
+ [ OID_END,
2, # availability
3, # state
4, # value
- ]),
+ ])],
"snmp_scan_function" : lambda oid: oid(".1.3.6.1.2.1.1.2.0") ==
".1.3.6.1.4.1.13742.6",
"includes" : [ 'raritan_pdu_inlet.include',
'elphase.include' ]
}