Monitoring for data in the SQL database from log4net
-
Friday, November 16, 2012 11:24 PM
Our developers have decided to log all their application logs into SQL DB using log4net.
Would SCOM 2012 be able to monitor those data that arrive into the SQL database.
Obviously the data are identified as fatal, warning, and informational.
We want to monitor for all those data that arrive into the SQL DB that are identified "fatal"
- Edited by SCOM 2012 Installation from Hell Friday, November 16, 2012 11:24 PM
All Replies
-
Saturday, November 17, 2012 6:57 AMModerator
Hi,
it depends on a log tables\db structure. If you can write a SQL query (or a stored procedure) that will return the data you need (let's say the newest row with a last log entry) you can write a script-based monitor that can query the DB and analyze the output (dataset) then decide if it's healthy or not...
http://OpsMgr.ru/
- Marked As Answer by Yog LiMicrosoft Contingent Staff, Moderator Wednesday, November 28, 2012 7:08 AM
-
Monday, November 19, 2012 7:34 AM
This blogpost will let you query the dbase for a designated place and monitor on the return value.
I think perhaps you will have to extend it to get more info out of the dbase: http://matthewlong.wordpress.com/2012/06/23/query-a-database-without-scripting-as-part-of-scom-monitoring-the-system-oledbprobe-module/
It's doing common things uncommonly well that brings succes.
- Marked As Answer by Yog LiMicrosoft Contingent Staff, Moderator Wednesday, November 28, 2012 7:08 AM
-
Monday, November 19, 2012 10:16 AMModerator
Hi
As another alternative ... could you discuss with the developers that they also use the application log appender within Log4Net. This way SCOM could quickly and easily pick up new events without worrying about SQL queries ad only picking up new data. This way they could have the events logged in a database for their usage. And you could get the same data into the event logs for SCOM to pick up quickly and easily.
Main issue is whether you can get SCOM agents on all the servers from which you are logging.
Just a thought.
Cheers
Graham
Regards Graham New System Center 2012 Blog! - http://www.systemcentersolutions.co.uk
View OpsMgr tips and tricks at http://systemcentersolutions.wordpress.com/- Marked As Answer by Yog LiMicrosoft Contingent Staff, Moderator Wednesday, November 28, 2012 7:08 AM

