Closed kylefarris closed 2 years ago
Also, love this project and am happy to contribute. Could probably use an update to ES6. If you're interested, let me know.
Thank you for your contribution and welcome to continue to provide PR in the future
package update to node-os-utils@1.3.6
It seems somewhere in the past few weeks or months, changes have been made to the headers for the output of
ip -s link
(at least on some distros). For what it's worth, it definitely changed on the distro I'm running: AlmaLinux 8.5 (Arctic Sphynx) which is basically an fully-open-source fork of CentOS 8. So, presumably, this will affect all fedora/centos/rhel-based distros.Expected Output
Example
New Output
Example
Differences
On the third line (starting with
RX
) for each interface, the headers are different. You'll notice it used to be:and now its:
So, namely
becomes
Solution
Thankfully the solution is simple and backwards-compatible. I've added additional possible headers to the RegEx pattern for collecting network stats for input bytes.
The RX pattern is now:
/ {4}RX: bytes {2}packets {2}errors {2}dropped (overrun|missed) {1,2}mcast\s*\n\s*([0-9]+) /gm
which is supports either
overrun
ORmissed
as the 5th header and 1 OR 2 spaces between it and the 6th header.