Running out of space "/dev/mapper/LVMG1-tmp (87%)" on Hostname as on Mon Feb 3 15:44:03 IST 2020
above is the message I'm getting in the email but I need to use a proper salutation and declaration how can I archive this kidly suggest your ideas?
Code :
#!/bin/sh
df -H | grep -vE '^Filesystem|tmpfs' | awk '{ print $5 " " $1 }' | while read output;
do
echo $output
usep=$(echo $output | awk '{ print $1}' | cut -d'%' -f1 )
partition=$(echo $output | awk '{ print $2 }' )
if [ $usep -ge 80 ]; then
echo "Running out of space \"$partition ($usep%)\" on $(hostname) as on $(date)" | mail -s "FILE SYSTEM ALERT" name@doamin.com
fi
done