Python Server Monitoring Scripts


A couple of simple scripts to keep an eye on memory and disk usage on a Linux server - tested and in use on Ubuntu 8.04 and 10.04, but should be useful on various other platforms. The end result should be a text log of memory and disk status, with warning emails whenever things get a bit tight. The scripts work by periodically parsing the output of the free and df commands.


Create a containing these settings:

SERVER_NAME = 'My Server'
EMAIL_HOST = 'localhost'
LOG_DIR = '~/log'


Add these to your crontab:

*          *  *   *   *     free -m | /path/to/
45         *  *   *   *     df -h | /path/to/

Get the code