For today we will use a bash script to monitor S.M.A.R.T. disks of a server. All script output will be stored in a text file with extension prom and exposed via node_exporter.
Enable node_exporter text collector
Create a folder and in your node_exporter service add the following parameter:
--collector.textfile.directory=/etc/node_exporter/data/
Download script from here and add it to /etc/crontab the following line which will execute script at every 5 minutes;
*/5 * * * * /etc/node_exporter/scripts/smartmon.sh > /etc/node_exporter/data/smartmon.prom.$$ 2>&1 && mv /etc/node_exporter/data/smartmon.prom.$$ /etc/node_exporter/data/smartmon.prom
Now import the following dashboard in grafana and you are monitoring S.M.A.R.T. starting from now.
Other panels can be built due to the infos exposed by the node_exporter.
0 Comments