hi,
im trying to setup a script which can look at a file and email me when a fail is present, this runs on cron every 10 minutes
Below is the file that will tell me if a PASS or FAIL has occured
$more monitor/results
Test: 01db_up.sh. Status: PASS. Message: db is up
Test: 02cm_up.sh. Status: PASS. Message: CM is running
Test: 03free_db.sh. Status: PASS. Message: 15% free space in data db
Test: 04free_log.sh. Status: PASS. Message: 99% free space in log db
currently i have this script
# Version - V0.1 19/08/09
#!/bin/ksh -xv
#test to see if the database is up and running
if [ $(grep "01db_up" monitor/results|grep FAIL|wc -l) -eq 1 ] ; then
mailx -s "Sybase Alert"
my.email@host.co.uk
else
fi
// the above works great but i just need to know how to set up a better script
How can i start to make this better, what else would i put in the else statement apart from nothing!!!
any advise is greatly appreciated
Jeffers