Simple Shell Script to Monitoring Disk Space on a Linux Machine
This article explain a way to get a mail as soon as the disk usage reaches to its critical level to avoid issues later. To set a simple monitor on Linux / Unix, I have two simple scripts: DSAlert.sh : Shell script for retrieving disk space percentages and put in to a cron job. DiskSpace_Alert.pl : Perl script for sending an email. Following is the disk monitor shell script which will execute the perl file for sending alert email. #DSAlert.sh #!/bin/sh #Retrive disk space info df=`df -Pl | grep “^/dev” | awk ‘{print $5, $6}’ | sed “s/%//”` #Reference: df echo “$df” | while read percent fs do #If Disk...