Module: check_mk
Branch: master
Commit: 4de572ee0cdc1a3fed45330e6ab1ce483091453c
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=4de572ee0cdc1a…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Sun Oct 25 18:21:26 2015 +0100
#2669 FIX mcdata_fcport: fix computation of in and out traffic
The computation of the traffic (in/out octets per seconds) was wrong after
a bug fix that tried to correct the computation by the factor of 4.
---
.werks/2669 | 10 ++++++++++
ChangeLog | 1 +
checks/mcdata_fcport | 8 ++++----
3 files changed, 15 insertions(+), 4 deletions(-)
diff --git a/.werks/2669 b/.werks/2669
new file mode 100644
index 0000000..cee417c
--- /dev/null
+++ b/.werks/2669
@@ -0,0 +1,10 @@
+Title: mcdata_fcport: fix computation of in and out traffic
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.7i4
+Date: 1445793604
+Class: fix
+
+The computation of the traffic (in/out octets per seconds) was wrong after
+a bug fix that tried to correct the computation by the factor of 4.
diff --git a/ChangeLog b/ChangeLog
index 9a5b7c0..30766f5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -22,6 +22,7 @@
* 2690 FIX: ps: Fixed processing of old inventory_processes rules in discovery
function...
* 2236 FIX: cups_queues: Correct not working discovery after werk #2504...
* 2668 FIX: jar_signature: Handle case correctly where certificate is already
expired
+ * 2669 FIX: mcdata_fcport: fix computation of in and out traffic...
Multisite:
* 2684 Added icons for downloading agent data / walks of hosts...
diff --git a/checks/mcdata_fcport b/checks/mcdata_fcport
index b172ee5..4715ca9 100644
--- a/checks/mcdata_fcport
+++ b/checks/mcdata_fcport
@@ -27,7 +27,7 @@
mcdata_fcport_speedbits = { "2": '1000000000', "3":
'2000000000' }
mcdata_fcport_opstatus = { "1" : "1", "2": "2",
"3": "testing", "4": "faulty" }
-def mcdata_bin_to_64(bin, mult = 1):
+def mcdata_bin_to_64(bin):
# McData encodes 64 bit counters as big endian HEX strings,
# e.g. Hex-STRING: 00 00 00 01 AC C2 8C EE. Check_MK converts
# such strings into binary Python strings
@@ -36,7 +36,7 @@ def mcdata_bin_to_64(bin, mult = 1):
for byte in bin[::-1]:
value += mult * ord(byte)
mult *= 256
- return str(value * mult)
+ return str(value)
def mcdata_fcport_convert_to_if64(info):
return map(mcdata_fcport_convert_line_to_if64, info)
@@ -55,13 +55,13 @@ def mcdata_fcport_convert_line_to_if64(line):
'6', # ifType 2
speed, # ifSpeed 3
opStatus, # ifOperStatus 4
- mcdata_bin_to_64(rxWords64, 4), # ifHCInOctets 5
+ mcdata_bin_to_64(rxWords64) * 4, # ifHCInOctets 5
mcdata_bin_to_64(rxFrames64), # ifHCInUcastPkts 6
'0', # ifHCInMulticastPkts 7
'0', # ifHCInBroadcastPkts 8
'0', # ifInDiscards 9
crcs, # ifInErrors 10
- mcdata_bin_to_64(txWords64, 4), # ifHCOutOctets 11
+ mcdata_bin_to_64(txWords64) * 4, # ifHCOutOctets 11
mcdata_bin_to_64(txFrames64), # ifHCOutUcastPkts 12
'0', # ifHCOutMulticastPkts 13
'0', # ifHCOutBroadcastPkts 14