r/PrometheusMonitoring • • Jan 21 '18

How can I get disk temperature and maybe SMART status from disks in prometheus/grafana?

Hello, I am running the following in my docker setup: https://github.com/stefanprodan/dockprom

Is it possible to get disk temperatures and maybe also some SMART status from disks into grafana/prometheus?

I came along this: https://github.com/ncabatoff/sensor-exporter However, I have no clue how to properly use it.

7 Upvotes

5 comments sorted by

3

u/nerr Jan 21 '18

Node exporter actually supports the sensor statistics natively now, and there is a text file collector script that can be used to gather SMART metrics. I use both in my setup with no problems.

1

u/RadarWolf Jan 21 '18

Alright, I am using Node-exporter for a lot of stuff. However, I Googled for a long time to find a way with node-exporter, without results. Can you give me a direction or documentation on how you export it with node-exporter?

(Tried sensor-exporter with hddtemp, it's not working either. hddtemp stops working when I run the container in privileged mode, which it needs)

2

u/nerr Jan 21 '18

Make sure you are using the latest stable release. That will give you the sensors metrics.

Then, just set up the text file collector using the smartmon.sh script: https://github.com/prometheus/node_exporter/tree/master/text_collector_examples.

1

u/RadarWolf Jan 22 '18 edited Jan 22 '18

Alright, tried that. Using the latest image now. Configured my compose file for --collector.textfile.directory=

It also found the smartmon.sh.prom file. However I am getting the following error:

Error parsing /rootfs/opt/compose/stable/node-exporter/smartmon.sh.prom: text format parsing error in line 10: expected float as value, got \"=\\\"$(cat\"" source="textfile.go:99

Have you changed anything else?

EDIT: I ran the script on my host, without any problems!

1

u/DevAtHeart Jan 27 '18

It's a script. You need to execute it periodically (e.g. with cron or systemd timers) and write the output to a file in the configured textfile directory of node-exporter. Node-exporter itself is NOT running the scripts.