I created a little script to keep track of the disk states (spindown/spinup) using collectd, InfluxDB and Grafana.
It is based on this script: https://github.com/collectd/co…ter/contrib/exec-smartctl
Now I can see in a nice graphic about which drive was spun up or down at wich point.
- collectd (to collect the data; is already part of OMV)
- InfluxDB (to store the data)
- Grafana (to show the data)
I will not explain how to install InfluxDB and Grafana. There are plenty of tutorials available.
First, you need to configure collectd to send the data to InfluxDB.
Create the following file to configure collectd to send data to your InfluxDB-Server.
Don't forget to change the ip address.
EDIT: I think I forgot to mention you need to copy https://github.com/collectd/co…/blob/master/src/types.db to /usr/share/collectd/types.db.
And also see this guide to prepare InfluxDB to receive data from collectd. https://anomaly.io/collectd-metrics-to-influxdb/
Create a user named 'smart' that has the permission to execute 'smartctl' with sudo.
Create the following file which will read the power state of your drives.
Change the list of drives ("[..] sda sdb sdc ...") according to your system.
If you execute the script manually it will take 60 seconds before the first output is printed.
As a bonus, here is the slightly modified version of the original exec-smartctl script.
This will read the disk temperature only when the disks are not in standby.
Don't forget to make the scripts executable.
Now we need to tell collectd to use these scripts.
Finally execute the following commands to create and activate the new collectd config.
At this moment the data should be sent to your InfluxDB.
The next step is to create a nice graph for this data.
To display the graph with discrete values install this plugin: https://grafana.com/plugins/natel-discrete-panel
I used this dashboard template as a starting point: https://grafana.com/dashboards/554
You can import my graphs using this json data.
I hope this will be of use for someone.
And feel free to give feedback in any way.