Module: check_mk
Branch: master
Commit: 19ded57967c427fcb2e101502a5e23c1bfa849a8
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=19ded57967c427…
Author: Lars Michelsen <lm(a)mathias-kettner.de>
Date: Fri Jul 29 09:47:10 2016 +0200
3727 FIX fc_port: Fixed broken interpretation of counter values leading to wrong
measurements
---
.werks/3727 | 10 ++++++++++
ChangeLog | 1 +
checks/fc_port | 20 +++++++++-----------
3 files changed, 20 insertions(+), 11 deletions(-)
diff --git a/.werks/3727 b/.werks/3727
new file mode 100644
index 0000000..c208919
--- /dev/null
+++ b/.werks/3727
@@ -0,0 +1,10 @@
+Title: fc_port: Fixed broken interpretation of counter values leading to wrong
measurements
+Level: 1
+Component: checks
+Class: fix
+Compatible: compat
+State: unknown
+Version: 1.4.0i1
+Date: 1469778404
+
+
diff --git a/ChangeLog b/ChangeLog
index 5873df9..ef2e826 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -318,6 +318,7 @@
* 3556 FIX: agent_vsphere.pysphere: The ESX 4.1 compatible agent version no longer
validates the ssl certificate
* 3709 FIX: cisco_wlc, cisco_wlc_clients: fixed scan function and incomplete listing
of interfaces
* 3672 FIX: Agent sections cached by the agent could cause stale services...
+ * 3727 FIX: fc_port: Fixed broken interpretation of counter values leading to wrong
measurements
Multisite:
* 3187 notification view: new filter for log command via regex
diff --git a/checks/fc_port b/checks/fc_port
index 1cde4c6..5f747e8 100644
--- a/checks/fc_port
+++ b/checks/fc_port
@@ -91,9 +91,7 @@ def fc_parse_counter(value):
# The counters are sent via SNMP as OCTETSTR, which is converted to
# a byte string by Check_MKs SNMP code. The counters seem to be
# 64 bit big endian values, which are converted to integers here
- if len(value) == len("00 00 00 0C 8F 70 DD 74"):
- value = "".join(map(chr, [ eval("0x" + v) for v in
value.split() ]))
- return binstring_to_int(value)
+ return binstring_to_int("".join(map(chr, value)))
def inventory_fc_port(info):
@@ -313,41 +311,41 @@ check_info["fc_port"] = {
"1.10.1.17", # connUnitPortName
# 5
"1.10.1.23", # connUnitPortHWSTate:
# 6
# hardware detected state of the port
- "4.5.1.4", # connUnitPortStatCountTxObjects:
# 7
+ BINARY("4.5.1.4"), # connUnitPortStatCountTxObjects:
# 7
# The number of frames/packets/IOs/etc that have been
transmitted
# by this port. Note: A Fibre Channel frame starts with
SOF and
# ends with EOF. FC loop devices should not count frames
passed
# through. This value represents the sum total for all
other Tx
- "4.5.1.5", # connUnitPortStatCountRxObjects:
# 8
+ BINARY("4.5.1.5"), # connUnitPortStatCountRxObjects:
# 8
# The number of frames/packets/IOs/etc that have been
received
# by this port. Note: A Fibre Channel frame starts with
SOF and
# ends with EOF. FC loop devices should not count frames
passed
# through. This value represents the sum total for all
other Rx
- "4.5.1.6", # connUnitPortStatCountTxElements:
# 9
+ BINARY("4.5.1.6"), # connUnitPortStatCountTxElements:
# 9
# The number of octets or bytes that have been
transmitted
# by this port. One second periodic polling of the port.
This
# value is saved and compared with the next polled value
to
# compute net throughput. Note, for Fibre Channel,
ordered
# sets are not included in the count.
- "4.5.1.7", # connUnitPortStatCountRxElements:
# 10
+ BINARY("4.5.1.7"), # connUnitPortStatCountRxElements:
# 10
# The number of octets or bytes that have been received.
# by this port. One second periodic polling of the port.
This
# value is saved and compared with the next polled value
to
# compute net throughput. Note, for Fibre Channel,
ordered
# sets are not included in the count.
- "4.5.1.8", # connUnitPortStatCountBBCreditZero:
# 11
+ BINARY("4.5.1.8"), # connUnitPortStatCountBBCreditZero:
# 11
# Count of transitions in/out of BBcredit zero state.
# The other side is not providing any credit.
- "4.5.1.28", # connUnitPortStatCountClass3Discards:
# 12
+ BINARY("4.5.1.28"), # connUnitPortStatCountClass3Discards:
# 12
# Count of Class 3 Frames that were discarded upon
reception
# at this port. There is no FBSY or FRJT generated for
Class 3
# Frames. They are simply discarded if they cannot be
delivered.
- "4.5.1.40", # connUnitPortStatCountInvalidCRC:
# 13
+ BINARY("4.5.1.40"), # connUnitPortStatCountInvalidCRC:
# 13
# Count of frames received with invalid CRC. This count
is
# part of the Link Error Status Block (LESB). (FC-PH
29.8). Loop
# ports should not count CRC errors passing through when
# monitoring.
- "4.5.1.50", # connUnitPortStatCountEncodingDisparityErrors:
# 14
+ BINARY("4.5.1.50"), # connUnitPortStatCountEncodingDisparityErrors:
# 14
# Count of disparity errors received at this port.
]),
}