Hi
I have been trying every possible solution available for this error on this Forum but could not resolve it.
When i am running the below script i get this error.
sh diskMonitor.sh
diskMonitor.sh[23]: -: 0403-053 Expression is not complete; more tokens expected.
diskMonitor.sh[23]: -: 0403-053 Expression is not complete; more tokens expected.
The Verison of Unix is : AIX 6.1
The Script is to monitor disk space and send alert mail.
Code is :
#!/usr/bin/ksh
#This script monitors available disk space.
# This script emails an alert when a locally mounted partition crosses a given threshold.
# Set your threshold percentage (do not include the % sign), email address, and excluded mount points, then add to crontab
#
# Add this to crontab -e for root
# Diskspace monitoring script
#0 6 * * 1-5 /bin/diskMonitor.sh >/dev/null 2>&1
THRESHOLD="99"
EMAIL="abe@atred.com"
HOSTNAME=`hostname`
# Excluded mount points *must* be pipe delimited
# "/proc|/export/home|Mounted" should always be included
EXCLUDE="/proc|/export/home|Mounted"
df -k | awk '{print $7"\t"$4}' |egrep -v "(${EXCLUDE})" | while read LINE; do
PERC=`echo $LINE |awk '{print $2}' | cut -d"%" -f1`
Path=`echo $LINE |awk '{print $1}'`
if [ $PERC -gt THRESHOLD ];
then
echo "*****ALERT on $HOSTNAME Disk Space Exceeded the Threashold.Current Usage is ${PERC}% on path ${Path} Please perform C
lean Up*****" | /usr/bin/mailx -r xrt@avft.com -s "ALERT `hostname`: Disk Space Alert: ${LINE} used " $EMAIL
fi
done
---------- Post updated at 04:32 AM ---------- Previous update was at 04:26 AM ----------
FYI
The Script is working and sending mail. Its doing what it should but with these two o/p error message which i want to get rid of ASAP so i can cron them.