script for get OS level space warning on linux

mntlist=”/orahome /oraredo1 /oraarch1 /ora01 /oradump01 /”
for ml in $mntlist
echo $ml
usedSpc=$(df -h $ml | awk ‘{print $5}’ | grep -v capacity | cut -d “%” -f1 -)
BOX=$(uname -a | awk ‘{print $2}’)
case $usedSpc in
arcStat=”relax, lots of disk space: $usedSpc”
arcStat=”disk space okay: $usedSpc”
arcStat=”space getting low: $usedSpc”
arcStat=”warning, running out of space: $usedSpc”
echo $arcStat $ml | mailx -s “space on: $BOX”
arcStat=”update resume, no space left: $usedSpc”
echo $arcStat $ml | mailx -s “space on: $BOX”
arcStat=”huh?: $usedSpc”
BOX=$(uname -a | awk ‘{print $2}’)
echo $arcStat
exit 0

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.