Module: check_mk
Branch: master
Commit: 04fa83c68f5a21f0a0e94cb36b3d2d1438fb91c8
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=04fa83c68f5a21…
Author: Sebastian Herbord <sh(a)mathias-kettner.de>
Date: Wed May 11 09:47:41 2016 +0200
3131 FIX if64, if64adm: These checks now display the speed of interfaces slower than 1Mbit
correctly
Previously, the two checks relied on a counter that has 10^6 bit resolution, so interfaces
with
less than 1Mbit speed were reported as "speed unknown", whereas the if check was
capped at 4Gbit
speed, reporting wrong speed for faster interfaces.
The if64, if64adm checks have now been updated to provide the correct speed for all
interfaces.
---
.werks/3131 | 12 ++++++++++++
ChangeLog | 1 +
checks/if64.include | 12 +++++++++---
3 files changed, 22 insertions(+), 3 deletions(-)
diff --git a/.werks/3131 b/.werks/3131
new file mode 100644
index 0000000..a6ba5e5
--- /dev/null
+++ b/.werks/3131
@@ -0,0 +1,12 @@
+Title: if64, if64adm: These checks now display the speed of interfaces slower than 1Mbit
correctly
+Level: 1
+Component: checks
+Compatible: compat
+Version: 1.2.9i1
+Date: 1462952497
+Class: fix
+
+Previously, the two checks relied on a counter that has 10^6 bit resolution, so
interfaces with
+less than 1Mbit speed were reported as "speed unknown", whereas the if check
was capped at 4Gbit
+speed, reporting wrong speed for faster interfaces.
+The if64, if64adm checks have now been updated to provide the correct speed for all
interfaces.
diff --git a/ChangeLog b/ChangeLog
index 59f4122..97463fa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -211,6 +211,7 @@
* 3528 FIX: netapp_api_protocol: fixed service discovery problem with older 7mode
versions
* 3529 FIX: agent_netapp: fixed problem with older netapp versions (7Mode - Version
8.0)...
* 3573 FIX: ps: Fixed possible wrong matching of ps and ucb ps commands
+ * 3131 FIX: if64, if64adm: These checks now display the speed of interfaces slower
than 1Mbit correctly...
Multisite:
* 3187 notification view: new filter for log command via regex
diff --git a/checks/if64.include b/checks/if64.include
index cfa27d5..fe9a65e 100644
--- a/checks/if64.include
+++ b/checks/if64.include
@@ -29,9 +29,14 @@
def parse_if64(info):
parsed = []
for line in info:
- # Fix for switches like DLINK, with empty lines in MIB
+ # some DLINK switches apparently report a broken interface with index 0,
+ # filter that out
if saveint(line[1]) > 0:
- parsed.append(line[:4] + [saveint(line[4]) * 1000000] + line[5:])
+ # ifHighSpeed (idx 21) can't represent interfaces with less than 10^6
bit bandwidth,
+ # ifSpeed (idx 4) is capped at 4GBit.
+ # combine the two to get the actual interface speed
+ real_speed = (saveint(line[-1]) * 1000000) + (saveint(line[4]) % 1000000)
+ parsed.append(line[:4] + [real_speed] + line[5:-1])
return parsed
@@ -69,7 +74,7 @@ if64_snmp_end_oids = [
"2.2.1.1", # ifIndex 0
"2.2.1.2", # ifDescr 1
"2.2.1.3", # ifType 2
- "31.1.1.1.15", # ifHighSpeed .. 1000 means 1Gbit
+ "2.2.1.5", # ifSpeed 3
"2.2.1.8", # ifOperStatus 4
"31.1.1.1.6", # ifHCInOctets 5
"31.1.1.1.7", # ifHCInUcastPkts 6
@@ -86,4 +91,5 @@ if64_snmp_end_oids = [
"2.2.1.21", # ifOutQLen 17
"31.1.1.1.18", # ifAlias 18
BINARY("2.2.1.6"), # ifPhysAddress 19
+ "31.1.1.1.15", # ifHighSpeed -1 (parse_if64 assumes this is
the last element)
]