#!/bin/bash
#Subject:- To know Disk space alert by mail
#Author- Deepak G Ghule
echo "Please put the partition to check"
read partition
var=`echo "$(df -k $partition | awk 'NR > 1 { print $5 }' | cut -d "%" -f1)"`
if [ $var -lt 75 ] && [ $var -lt 80 ]; then
echo "System is working with $var"
echo $var > mail -s "Disk space is use"
elif [ $var -lt 85 ]; then
echo $var > mail -s "Disk space is use" root
echo "system is in warning with $var:"
elif [ $var -gt 85 ]; then
echo $var > mail -s "Disk space is use" root
echo "System in dangerous zone"
fi
Blog Archive
-
▼
2009
(8)
-
▼
October
(8)
- Sending mails using the command line
- Let us ping range of IPs machine
- Useradd via shell script IN Linux
- To check desire machine status for up or down by I...
- To know Disk space Alert by mail in Linux
- Access Windows shares from the terminal
- Aircel/Airtel GPRS on linux via USB cable/bluetoot...
- To check Linux service is on or off
-
▼
October
(8)