ethtool Prometheus metrics

1,334 views
Skip to first unread message

Hemedi Salim

unread,
Jul 7, 2022, 5:12:33 AM7/7/22
to Prometheus Users
Hi.
I am still learning and new in this monitoring field. 
at the moment am using node-exporter to get metric to prometheus, but the node-exporter am using is not provide the metrics with comes from ethtool, the like of:
-rx/tx queue

-Laser output power              

-Receiver signal average optical power    

 -Module temperature        

Is there any exporter or  way of  getting these metrics (ethtool metric) to prometheus and display in grafana? 

Please help.
                

Brian Candler

unread,
Jul 7, 2022, 6:06:28 AM7/7/22
to Prometheus Users
I guess it's data from "ethtool -m" that you're interested in?

node_exporter already has an ethtool collector, although it's disabled by default (add "--collector.ethtool" to the command line to enable it). It only gives data from "ethtool", "ethtool -S" and "ethtool -i", but at least that gives you rx/tx queue information you wanted.  I think it would be a reasonable feature request to handle "ethtool -m" as well.

Googling "prometheus node_exporter ethtool" gives this as the first hit:
Looking at the source, it does appear to collect ethtool -m. It only retains certain metrics, but they include the ones you listed.  It should be easy enough to modify if necessary.

Failing that, you can write a cronjob which parses ethtool output and writes to a metrics file that the node_exporter textfile collector can pick up.

Hemedi Salim

unread,
Jul 8, 2022, 9:39:18 AM7/8/22
to Prometheus Users
Hi Brian, 

Thanks very much. and I am very interested in the last line of your answer, I think that would do for a short time, while I am looking for a permanent solution. 
I can write the cronjob with no problem at all, but how to parse the output to the metrics file that the node_exporter textfile collector can pick up, I do not know how. Please if possible can you give me a bit of hint on where the path to that file or how the output is exactly passed to the metric file to be collected with node_exporter, I will appreciate it.

please help

Thanks

--
You received this message because you are subscribed to the Google Groups "Prometheus Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to prometheus-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/prometheus-users/34cebfc2-4333-457e-9fae-d924109e72f7n%40googlegroups.com.

Brian Candler

unread,
Jul 8, 2022, 5:58:00 PM7/8/22
to Prometheus Users
The path [to a directory] is whatever you pass to node_exporter when you start it: e.g.

/opt/node_exporter/node_exporter --collector.textfile.directory=/var/lib/node_exporter

Then all files /var/lib/node_exporter/*.prom will be picked up.

There are lots of examples of scripts which write metrics for textfile collector in this repository:
Reply all
Reply to author
Forward
0 new messages