-
-
Save patagonaa/6bcf957175f5c296af5ad2aa803b9d8f to your computer and use it in GitHub Desktop.
#!/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" |
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
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.
Usage:
/usr/local/bin/prometheus_mellanox_temp.sh
(or somewhere else, it isn't that important)mst status
also, the textfile collector path might be different (e.g.
/var/lib/prometheus/node-exporter/
Example:
*/5 * * * * /usr/local/bin/prometheus_mellanox_temp.sh "01:00.0" | sponge /var/lib/node_exporter/textfile_collector/prometheus_mellanox_temp.prom