Module: check_mk
Branch: master
Commit: d709daf05f06347332b2c144c045ef818e02e229
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=d709daf05f0634…
Author: Simon Betz <si(a)mathias-kettner.de>
Date: Fri Jan 26 10:49:35 2018 +0100
5623 FIX lnx_if: Do not ignore interface any more if no speed information is available
Change-Id: If4125e3d0f73ea30d3724468a33e799575d90b6d
---
.werks/5623 | 11 +++++++++++
inventory/lnx_if | 4 ++--
web/plugins/views/inventory.py | 6 +++---
3 files changed, 16 insertions(+), 5 deletions(-)
diff --git a/.werks/5623 b/.werks/5623
new file mode 100644
index 0000000..1baaa1a
--- /dev/null
+++ b/.werks/5623
@@ -0,0 +1,11 @@
+Title: lnx_if: Do not ignore interface any more if no speed information is available
+Level: 1
+Component: inv
+Class: fix
+Compatible: compat
+Edition: cre
+State: unknown
+Version: 1.5.0i3
+Date: 1516960129
+
+
diff --git a/inventory/lnx_if b/inventory/lnx_if
index be1b8de..2794079 100644
--- a/inventory/lnx_if
+++ b/inventory/lnx_if
@@ -42,7 +42,7 @@ def inv_lnx_if(parsed, params):
if_in_errors, if_out_octets, outucast, outmcast, outbcast, \
if_out_discards, if_out_errors, if_out_qlen, if_alias, if_phys_address in
parsed:
- if if_type in ( "231", "232" ) or not if_speed:
+ if if_type in ( "231", "232" ):
continue # Useless entries for
"TenGigabitEthernet2/1/21--Uncontrolled"
# Ignore useless half-empty tables (e.g. Viprinet-Router)
@@ -50,7 +50,7 @@ def inv_lnx_if(parsed, params):
"index" : int(if_index),
"description" : if_descr,
"alias" : if_alias,
- "speed" : int(if_speed),
+ "speed" : if_speed,
"phys_address" : render_mac_address(if_phys_address),
"oper_status" : int(if_oper_status),
"port_type" : int(if_type),
diff --git a/web/plugins/views/inventory.py b/web/plugins/views/inventory.py
index c05cafb..bb53846 100644
--- a/web/plugins/views/inventory.py
+++ b/web/plugins/views/inventory.py
@@ -252,10 +252,10 @@ def inv_paint_bytes_rounded(b):
def inv_paint_nic_speed(bits_per_second):
- if bits_per_second == 0:
- return "", ""
+ if bits_per_second:
+ return "number", nic_speed_human_readable(int(bits_per_second))
else:
- return "number", nic_speed_human_readable(bits_per_second)
+ return "", ""
def inv_paint_if_oper_status(oper_status):