Marcel1958
Technical User
I need to monitor the disk space so i wrote this little script to send an email when the free space is to low. Problem is that when the first problem is found the script stops. When i do only the echo command it works ok.
user0="root"
user1="mg.bogaard@xxx.nl"
user2="r.van_der.vliet@xxx.nl"
user3="boogjes@xxx.com"
HOSTNAME=`hostname`
df -k | tr -d "%" |
while read filesystem blocks free gebruik A1 iused mounted
do
if [ "$gebruik" -gt "60" ]
then
echo $mounted $gebruik
mail -s "$filesystem on $HOSTNAME is $gebruik % vol" -c "$user1" $user0
fi fi
done
user0="root"
user1="mg.bogaard@xxx.nl"
user2="r.van_der.vliet@xxx.nl"
user3="boogjes@xxx.com"
HOSTNAME=`hostname`
df -k | tr -d "%" |
while read filesystem blocks free gebruik A1 iused mounted
do
if [ "$gebruik" -gt "60" ]
then
echo $mounted $gebruik
mail -s "$filesystem on $HOSTNAME is $gebruik % vol" -c "$user1" $user0
fi fi
done