proutil [i]database[/i] -C busy > /dev/null 2>&1
if [ $? = 0 ]; then
echo "Database [i]database [/i]is down" > alert.d
mailx -s "DATABASE DOWN" [email="user@domain.com"][i]user@domain.com[/i][/email] < alert.d
fi
Norman Biggar said:Here's some "bones" to examine.
You can vary the message based on the return value $?. (Different versions of UNIX/Progress give different results).
Code:proutil [i]database[/i] -C busy > /dev/null 2>&1 if [ $? = 0 ]; then echo "Database [i]database [/i]is down" > alert.d mailx -s "DATABASE DOWN" [email="user@domain.com"][i]user@domain.com[/i][/email] < alert.d fi
SpyKey said:Hey y'all!
Anyone by any chance has a Unix script (an outline will do) which would check whether a db is running, and if it is not the case would send an alert of some sort to an admin, like SMS or an e-mail?
Thanks much.