Quote:
Originally Posted by csaunders
I gave this my own shot
# vi check_ora
"check_ora" 14 lines, 302 characters
#program to grep orac error and email admin
#5-15-06
#Chris Saunders
if grep ORA-12157 /u01/AIDMS/log/AIDMS_default_island_1/aidms.log
then
echo "Oracle issues on cluster" | mailx -s "SQLException: ORA-12157: TNS:internal network communication error" saundersc
@hostname
fi
echo $?
but i cant get the email. this is just a starting point... i posted in the solaris forum on why i cant receive the email...
You are not getting anything because your "if" statement has no validation.
In layman's terms, your statement reads:
"if I look in this file for this information, then..."
It should read:
"if I look in this file for this information AND I find it, then..."
The snippet that I posted before should work. Obvioulsy is not the solution, since you want to get an e-mail every time you get the alarm, and the snippet I posted will e-mail you as long as there is 1 entry anywhere in your log file.
Now, are the entries in your log file time stamped?