ethtool-lua + prometheus-node-exporter-lua plugin #24101
+88
−0
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.
The ethtool-lua library is a partial re-implementation of the ethtool. The goal is to provide the CLI queries and configuration options as a Lua API.
The reason for starting this library, was the desire for a nice and efficient way to query DSA switch statistics in the prometheus-node-exporter-lua on OpenWRT devices. Existing suggestions around the internet focussed mainly on calling the ethtool CLI program and parsing the output. This is neither elegant nor efficient, as the collection time for this implementation was 300% higher on my rtl838x based switch running OpenWRT.