- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Emailing alerts
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-02-2003 07:07 AM
тАО06-02-2003 07:07 AM
Emailing alerts
I'm trying to set up a background job that would email me when the alert.log received an error msg. I've been trying to use tail -f |grep 'ORA-' but it appears the 'mail' command only works when an EOF is issued. So I never get emails until the process is terminated. I didn't want to have a process run each minute or so and email me the last 10-20 lines of the alert.log because on slow periods the alert.log might not grow enough. Does anyone have any suggestions?
thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-02-2003 07:21 AM
тАО06-02-2003 07:21 AM
Re: Emailing alerts
You could write a script which
1) touch toto
2)does a tail ora.log>titi then compares titi with the previous toto and if different send you via email and renames titi to toto...
Then you execute your script as a cron job
All the best
Victor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-02-2003 08:28 AM
тАО06-02-2003 08:28 AM
Re: Emailing alerts
I use the following:
Filename: alerts.ksh (attached)
Description: Automatic monitoring of the production database's ALERT LOG file for exceptions.
Running it as the Oracle User, reschedules daily execution of script - morning, evening and night everyday (uses at)
Makes monitoring of the Alert log easy task!
Hope this helps!
Best Regards
Yogeeraj
PS. Don't forget to modify lines:
a. DBA1='myname@mymailserver.mu'
b. SID=pfs
to suit your own enviroment
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-02-2003 09:06 AM
тАО06-02-2003 09:06 AM
Re: Emailing alerts
tail f- $ORACLE_BASE/admin/$SID/bdump/alert_$SID.log |grep 'ORA-'
This just displays any new lines in the alert.log to my screen. It won't go to the email until I terminate the process. So I believe 'mail' looks for a EOF character before it sends the msg. At the moment I'm using the alert oracheck.run script that compes with the statspack. This is based on a job interval also.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО06-02-2003 10:04 AM
тАО06-02-2003 10:04 AM
Re: Emailing alerts
#!/path/to/your/perl
while (<>) {
if (/ORA-/) {
open $ML, "|/usr/bin/mailx -s 'ORACLE Alert' user@domain.com";
print $ML $_;
close $ML;
}
}
Call it as:
tail -f /path/to/oracle.log | perlscript.pl