Last active
December 3, 2024 23:52
-
-
Save patagonaa/6bcf957175f5c296af5ad2aa803b9d8f to your computer and use it in GitHub Desktop.
Prometheus textfile collector script for Mellanox Connect-X temperature (for getting temperature of Mellanox SFP+ Ethernet cards)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
echo '# HELP node_mlx_temperature Mellanox networking card temperature.' | |
echo '# TYPE node_mlx_temperature gauge' | |
temperature=`mget_temp -d $1 | tr -d '[[:space:]]'` | |
echo "node_mlx_temperature{device=\"$1\"} $temperature" |
Hi, can you please explain more how did you set it up with node-exporter with your script? To be honest I'm new into this and little bit confused. Thank you and great job 👍
as I said, this thing is pretty much unnecessary as there already is a mellanox exporter included with node exporter (at least on debian).
If you still want to use it, basically the script just outputs the prometheus values to stdout. The cronjob I've posted periodically calls the script and pushes the output to a file that node_exporter reads.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Update: this is completely unnecessary, there's a mellanox exporter in the debian package, you only have to install the firmware tools and then reinstall the prometheus-node-exporter package to enable the timer which runs the exporter