These steps will guide how to add Disk Storage monitor report into the Monit web access
First, you need to know which drive you want to be included into the Monit report by following command
1 2 3 | df |
For example here I have one partition /dev/vda1 and I want to monitor it with the usage detail.
Update the Monit configuration file
Now open the monit config file by the path: /etc/monit.d/storagespace
Create that file if it is not existed. Paste the following content
1 2 3 4 | check filesystem Ubuntu with path /dev/vda1 if space usage > 90% then alert |
If you have multiple volumes, easy that clone those 2 lines in multiple breakdown. Note that Ubuntu is the optional name you want to be showed as alias name in report.
Done, save it.
Check and Restart Monit process
Check the configuration file is ok by command
1 2 3 | sudo monit -t |
It will output *Control file syntax OK* means fine, otherwise try to review again your config file.
Restart monit service
1 2 3 | systemctl restart monit |
Check for status of service
1 2 3 | systemctl status monit |
So everything is fine, now point to web browser to access monit report, by default port is 2812 and your url will look like http://<host>:2812
The monit monitoring my disk right now, so click on it will go to details
Finished!