rheasam
asked on
VBScript to look for certain error in logs and send out an email/alert
I have a log which contains errors. I want to look for http 500 errors within these logs. So I need a script/monitoring system for windows which looks at these logs every hour and if it find "http 500" in error.log it needs to send out an alert/email to a distribution list. What is the best way to do that?
ASKER
what if my error is not 500 it is something else and the error no is not know,
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
The 500.asp page could have code from something like this (or my example attached);
http://www.codeproject.com/KB/asp/trap_asp_sql_error.aspx
and mixed with the email part from here (or my example attached);
http://www.asp101.com/samples/viewasp.asp?file=email_html.asp
The attached code works well for me and is a combination of the above two links. Save the attached as 500-100.asp and place within the website. Like I mentioned, alter the IIS configuration to redirect 500-100 errors to this new page. Two good things about this are that one, you will get far more data captured when the error happened and two, why wait till the script runs - why not act on the error right away.
Open in new window