Hello Andrew,
Thank you for the suggestion.
EXTERNAL EMAIL: Do not click links or open attachments unless you know the content is safe
Since you have batteries included python:
ethtool --json enp2s0 [sudo] password for andrew: [ { "ifname": "enp2s0", "supported-ports": [ "TP","MII" ], "supported-link-modes": [ "10baseT/Half","10baseT/Full","100baseT/Half","100baseT/Full","1000b aseT/ Full" ], "supported-pause-frame-use": "Symmetric Receive-only", "supports-auto-negotiation": true, "supported-fec-modes": [ ], "advertised-link-modes": [ "10baseT/Half","10baseT/Full","100baseT/Half","100baseT/Full","1000b aseT/ Full" ], "advertised-pause-frame-use": "Symmetric Receive-only", "advertised-auto-negotiation": true, "advertised-fec-modes": [ ], "auto-negotiation": false, "master-slave-cfg": "preferred slave", "master-slave-status": "unknown", "port": "Twisted Pair", "phyad": 0, "transceiver": "external", "supports-wake-on": "pumbg", "wake-on": "d", "link-detected": false } ]
You can use a json library to do all the parsing for you.
I tried running the --json option with the ethtool ("ethtool --json enp9s0"),
however I am not getting the above output.
Instead it always throws "ethtool: bad command line argument(s)" I am figuring out what might be missing (or any suggestions would be
helpful).
Are you using real ethtool, or busybox? What version of ethtool? I'm using 6.10, but it looks like JSON support was added somewhere around 5.10.
I have been using ethtool 6.7, updating to ethtool 6.10 solved the problem.