Check FS Oracle

script de check FS

 

#!/bin/bash
# ScriptName : Check_FS.sh
#
#
#############################################################################################

# FS to check

mntlist=”/XDCEZG /backup/SLZ00639 /applications ”
for ml in $mntlist
do
echo $ml
usedSpc=$(df -h $ml | awk ‘{print $5}’ | grep -v capacity | cut -d “%” -f1 -)
BOX=$(uname -a | awk ‘{print $2}’)
#
case $usedSpc in
[0-9])
arcStat=”relax, lots of disk space: $usedSpc”
;;
[1-7][0-9])
arcStat=”disk space okay: $usedSpc”
;;
[8][0-9])
arcStat=”space getting low: $usedSpc”
;;
[9][0-9])
arcStat=”warning, running out of space: $usedSpc”
echo $arcStat $ml | mailx -s “space on: $BOX” dbaoracle@gmail.com
;;
[1][0][0])
arcStat=”update resume, no space left: $usedSpc”
echo $arcStat $ml | mailx -s “space on: $BOX” dbaoracle@gmail.com
;;
*)
arcStat=”huh?: $usedSpc”
esac
#
BOX=$(uname -a | awk ‘{print $2}’)
echo $arcStat
#
done
#
exit 0

 

crontab

 

#—————————————————————–
# Filesystem check
7 * * * * /orahome/oracle/bin/Check_FS.sh 1>/orahome/oracle/bin/log/filesp.log 2>&1
#—————————————————————–

Post Comment

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *