shell scripting [message #225342] |
Mon, 19 March 2007 13:37 |
plshelp
Messages: 205 Registered: January 2007
|
Senior Member |
|
|
Hi all,
I need to change the below script to ignore the monitoring for the cdrom..This script checks the entire filesystem.. Can somebody help me what to add in the script to ignore the monitoring for the cdrom? Thank you.
##set the oraenv profile
if [ -s /home/ora/oracle10.profile ]
then
. /home/ora/oracle10.profile
fi
##
export SCRATCH_DIR=/temp
export FILE_FULL=$SCRATCH_DIR/file_full$hostname.log
hostname=`hostname`
if [ ! -d $SCRATCH_DIR ]
then
mkdir $SCRATCH_DIR
fi
# Delete old files.
rm -f $SCRATCH_DIR/db_filesys*
cat /dev/null > $SCRATCH_DIR/db_filesys.$hostname
#
# Find all the file systems that needs to be monitored.
#
echo "****** Monitoring the File System for `hostname` ******
`date`"> $SCRATCH_DIR/db_filesys.$hostname
df -k >> $SCRATCH_DIR/db_filesys.$hostname
# Check filesystem is full
egrep -i "95%|96%|97%|98%|99%|100%" < $SCRATCH_D\
IR/db_mon_filesys.$hostname > $FILE_FULL
# Check file is not empty
if [ -s $FILE_FULL ]
then
echo " Filesystem full->$hostname"
echo "
Filesystem full->$hostname">>$SCRATCH_DIR\
/db_filesys.$hostname
mailx -s "File system full->`hostname` " michelle_g@getch.com < $SCRATCH_DIR/db_filesys.$hostname
else
mailx -s "File System on `hostname` " michelle_g@getch.com < $SCRATCH_DIR/db_filesys.$hostname
fi
exit
LOGFILE:
Filesystem kbytes used avail capacity Mounted on
/vol/dev/dsk/c1t0d0/sol_9_905_sparc/s5 31 2 26 8% /cdrom/sol_9_905_sparc/s5
/vol/dev/dsk/c1t0d0/sol_9_905_sparc/s4 31 2 26 8% /cdrom/sol_9_905_sparc/s4
/vol/dev/dsk/c1t0d0/sol_9_905_sparc/s3 31 2 26 8% /cdrom/sol_9_905_sparc/s3
/vol/dev/dsk/c1t0d0/sol_9_905_sparc/s2 31 2 26 8% /cdrom/sol_9_905_sparc/s2
/vol/dev/dsk/c1t0d0/sol_9_905_sparc/s1 506399 479106 0 100% /cdrom/sol_9_905_sparc/s1
/vol/dev/dsk/c1t0d0/sol_9_905_sparc/s0 2405544 2405544 0 100% /cdrom/sol_9_905_sparc/s0
/dev/md/dsk/d220 106447246 63601395 41781379 61% /bkup
/dev/md/dsk/d60 34190853 4851724 28997221 15% /ora
.
.
.
.
.
Please advise how I can ignore the checking for cdrom space in the script..Help appreciated..Thanks..
|
|
|
|
|