Skip to content

Fixed getNetData to work with all Linux distros #15

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

deiter
Copy link

@deiter deiter commented Dec 22, 2023

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. Fixes #14

Thank you!

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 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MainThread: Error, cannot match for network related data in "ip -s link" output on node 10.0.0.9
1 participant