Main menu

Tag Archives: cron

Server monitoring should always be in place especially when you are handling a lot of servers, there are few opensource monitoring application like Nagios, Cacti and many more. You can create your own script for monitoring, such as for disk usage and all. Once they have reached over the threshold you have set they will automatically send you an email alert.

A sample script below will send you an alert once the root partition is almost full:

It will print the output on the fifth column/lines but will delete the “%” character which will be called the CURRENT usage

In the condition if the CURRENT usage is greater than the threshold which is 85 it will send an email to burnz@thesysad.com with a Subject “Disk Space Alert” and message as Your root partition remaining free space is critically low. Used: $CURRENT%

If you don’t have monitoring server you can put this script in all of your servers and run them daily using a cron jobs.