Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Monitoring SQL Server error logs

Author  Topic 

eyechart
Master Smack Fu Yak Hacker

3575 Posts

Posted - 2003-06-26 : 13:34:24
Anyone have any tips and/or code for monitoring the sql error logs?


-ec

Shastryv
Posting Yak Master

145 Posts

Posted - 2003-06-26 : 17:31:35
If you have too many error messages in your error log and need immediate focus it good to write a procedure to look for the Phrase “Error” in the error log and setup either an Alert or mail notification. If not use sp_readerrorlog in QA.

Go to Top of Page

eyechart
Master Smack Fu Yak Hacker

3575 Posts

Posted - 2003-06-26 : 18:13:54
I'm just looking for something that has already been written so I don't have to reinvent the wheel.

basically, what I would like to implement is something that checks the error log at regular intervals, and then notifies us via email and pager to errors that are found.

We currently have a tool in place that monitors event logs in this way, but we do not have anything that monitors the sql server error logs.


-ec

Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2003-06-26 : 18:35:46
Errors that get listed in the SQL Server Error log also get listed in the Event Viewer, so your current monitoring system should already work.

Tara
Go to Top of Page

Shastryv
Posting Yak Master

145 Posts

Posted - 2003-06-27 : 13:33:21
Here is a Script that looks for the Errors in the Error log. You need to schedule a job in a regular intervals depends on your application. Also you can either configure a sql mail or setup an alert to raise.

CREATE TABLE #Errors (vchMessage varchar(255), ID int)
CREATE INDEX idx_msg ON #Errors(ID, vchMessage)
INSERT #Errors EXEC xp_readerrorlog
SELECT vchMessage FROM #Errors WHERE vchMessage LIKE '%Error%'
Drop table #Errors



Go to Top of Page
   

- Advertisement -