How to I email notify on disk utilization exceeded?
I see in the settings section there is a set of email notifications that can be triggered when CPU, Network, Disk I/O thresholds are exceeded. But nothing about disk utilization thresholds to notify when a disk is getting full. What's the best practice to monitor and notify disk utilization for Linodes?
4 Replies
Currently, Linode does not offer email notifications for disk usage. This is due to the fact that we gather that available threshold information from outside of the Linode itself. In order to have accurate readings of the disk usage from within the Linode, in real-time, you would need to use an application or script that is located from within the server.
There are a few ways that this can be done. We do offer a service called Longview. This client is installed on the Linode itself and the data is available in the form of graphs on the Linode's dashboard. While these graphs will pull from real-time data and can be viewed at a glance from the Overview page, Longview does not send notification alerts.
There are a few ways that you can set up notification alerts for your Linode. One of them is with bash scripts.
Linode has a guide called A Tutorial for Solving Real World Problems with Bash Scripts that will give you some more information about use cases for bash scripting. There is a section in this guide that includes a sample script that you can use to watch for free disk space. Please, keep in mind that the script as is doesn't include a line to notify you by email.
Below are links to resources that use a similar technique and include email notifications as well as SMS notifications.
- Linux Shell script to monitor Disk Space usage with email alert
- Tech Tip: Send an Email Alert When Your Disk Space Gets Low
- How can I send mobile text message from terminal?
You can also using a monitoring tool like Nagios that has email notification settings.
I hope this info gives you a good start, and that it is helpful!
Longview also requires agent to be installed in the server.
Extend to alerting feature, which is very helpful if provided by Linode.
Any plan to develop this feature?
2.5 years later: I have Longview installed, it sees the available disk space, can I set up some kind of an alert? If not, is there a plan to provide such feature? If not please file a feature request in the related issue tracking environment and like +10 it.
@csabatoth --
This would be a very easy shell script to build yourself with cron, du or df (depending on the kind of info you want to monitor…and the granularity) and awk. About a couple of hours worth of work, I'd say…
-- sw