Databases
cancel
Showing results for 
Search instead for 
Did you mean: 

KSH script to monitor ALERT log in real time

SOLVED
Go to solution
Greg OBarr
Regular Advisor

KSH script to monitor ALERT log in real time

I run this script every 5 minutes using cron. I have caught problems on a number of occasions with tablespace sizes, etc. before users were even aware of them.
The use of the block number in the file prevents being paged more than once about the same error.
6 REPLIES
Greg OBarr
Regular Advisor

Re: KSH script to monitor ALERT log in real time

This was supposed to be a reply to the request for Oracle scripts. I don't know why it went in as a separate post.
David Totsch
Valued Contributor

Re: KSH script to monitor ALERT log in real time

Greg:

Here is a technique I have used successfully to scan /var/adm/syslog/syslog.log for new error messages.

First of all, I log my own message to the log. Something like "Log viewed to this point as of ." I also append an exact copy of that message into a separate log. Then, I can take the last two messages as 'from' and 'to' identifiers for sed(1). Something like this:

FROM=$(tail -2 mylog | head -1)
TO=$(tail -1 mylog)
sed -n "/${FROM}/,/${TO}/p" | ......

Enjoy,
-dlt-
Pete Randall
Outstanding Contributor

Re: KSH script to monitor ALERT log in real time

Greg,

It appears that you clicked on the "new message" button rather than the "reply" button.

Pete

Pete
Greg OBarr
Regular Advisor

Re: KSH script to monitor ALERT log in real time

David, that's a great idea. And Pete, I agree, it looks like I made an ID-10-T error in the reply (that's id10t.....)
Pete Randall
Outstanding Contributor

Re: KSH script to monitor ALERT log in real time

Greg,

Actually, it happens fairly often - don't beat yourself up over it!

;^)

Pete

Pete
Steven E. Protter
Exalted Contributor
Solution

Re: KSH script to monitor ALERT log in real time

Greg, you meant to post your post here. You got new message instead of reply

Post it here.

I'll slam you with a ten spot.

http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0x4177ef70e827d711abdc0090277a778c,00.html

P
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com