Sentora Support Forums

Full Version: Disk space alerts [Linux]
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
For another project I recently had to implement a warning system to alert when a server was close to reaching a defined threshold of disk space. The script I wrote is for Linux servers and can be found at https://github.com/KevinFairbanks/diskMonkey

To implement on your server upload diskMonkey to a spot on your server, for me I have a directory in my root user home directory called scripts. 

Add execute permissions to the file:
Code:
chmod +x diskMonkey

Add the script to your crontab:
Code:
crontab -e
I set mine to run every 5 minutes
Code:
*/5 * * * * /root/scripts/diskMonkey

Options:
At the top of the diskMonkey file you will find 3 options to control the script

ADMIN - where the notifications go can be local user ie root or remote email address ie you@yourdomain.tld

ALERT - the level at which you want alerts to appear, anything over this level will be notified

EXCLUDE_LIST - any partitions you wish to ignore