Module: check_mk
Branch: master
Commit: f96071ee5af8fb3e09af98f7b7d1a7dd5d8ebf41
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=f96071ee5af8fb…
Author: Mathias Kettner <mk(a)mathias-kettner.de>
Date: Fri Apr 29 10:02:36 2011 +0200
mcdata_fcport: fix computation of traffic
---
checks/mcdata_fcport | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/checks/mcdata_fcport b/checks/mcdata_fcport
index ed71956..2dff73b 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):
+def mcdata_bin_to_64(bin, mult = 1):
# 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):
for byte in bin[::-1]:
value += mult * ord(byte)
mult *= 256
- return str(value)
+ return str(value * mult)
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), # 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), # ifHCOutOctets 11
+ mcdata_bin_to_64(txWords64, 4), # ifHCOutOctets 11
mcdata_bin_to_64(txFrames64), # ifHCOutUcastPkts 12
'0', # ifHCOutMulticastPkts 13
'0', # ifHCOutBroadcastPkts 14