Hi All..
Previously i've posted my question regarding this script and i managed to solve the problem but i need to modified my script so it will meet the new requirement.
Below is the script and output:
--------------------------------------------------------------
-bash-3.00$ more check_oracle_filesystem.ksh
#!/bin/ksh
for i in `df -k|grep /ek_|awk '{ print $4 }'`
do
# Convert the file size to a numeric value
filesize=`expr i`
#Display the partiton name that less than 6000000k
df -k|grep /ek_ > /ek_bkup/alert/part_info.txt
# If any filesystem has less than 6000000k, issue an alert
if [ $filesize -lt 6000000 ]
then
mailx -r
oraadm@juwpkl.gov.my -c "encass@nc.com.my
technical@precisionportal.com.my"\
-s "Oracle filesystem $i has less than 6000000k free"\
fauzi@precisionportal.com.my < /ek_bkup/alert/part_info.txt
fi
done
------------------------------------------------------------------
output :
User will receive email that state at the subject email with "Oracle filesystem 0 has less than 6000000k free" with email content from part_info.txt
So my question is, how to show the partition name instead of 1234567?
Based on this command below, i want to show the "Mounted on" instead of "avail"
Filesystem kbytes used avail capacity Mounted on
/dev/md/dsk/d301 141168826 23093091 116664047 17% /ek_bkup
/dev/md/dsk/d402 10210996 5820267 4288620 58% /ek_logs1
/dev/md/dsk/d401 10323964 10220725 0 100% /ek_ora
/dev/md/dsk/d403 10210996 5631195 4477692 56% /ek_logs2
/dev/md/dsk/d404 10210996 7008404 3100483 70% /ek_logs3
Soon when the user receive the email, it will state "Oracle filesystem ek_ora has less than 6000000k free"
Thats all...hopefully somebody that really expert in ksh will assist me...