Fixed getNetData to work with all Linux distros#15
Open
deiter wants to merge 1 commit intoIBM:masterfrom
Open
Conversation
Different Linux distributions are based on different
versions of the iproute program.
And different versions of iproute have a different output of
the `ip -s link show` command. For example:
RHEL 8.x, RHEL 9.x, Debian Linux 11.x, Ubuntu Linux 22.04, CentOS 9.x:
eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500
RX: bytes packets errors dropped missed mcast
24853310197 16845711 0 0 0 0
TX: bytes packets errors dropped carrier collsns
39899639748 979955 0 0 0 0
RHEL 7.x, SLES 12.x, Ubuntu Linux 18.04, Ubuntu Linux 20.04:
eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500
RX: bytes packets errors dropped overrun mcast
31158468129 1501879 0 0 0 0
TX: bytes packets errors dropped carrier collsns
40617993630 1183331 0 0 0 0
And we can parse both options missed and overrun.
Signed-off-by: Alex Deiter <adeiter@tintri.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Different Linux distributions are based on different versions of the iproute program.
And different versions of iproute have a different output of the
ip -s link showcommand. For example:And we can parse both options missed and overrun. Fixes #14
Thank you!