Posted by: Colin Smith
when relevant content is
added and updated.
While I was back east at the home office I was asked to look into a way to monitor DB Mirroring. I had a couple thoughts on this as I know that I can look at the status of the mirror via SMO using Powershell and then alert if the status is not Synched. But I was in a time crunch so I did some quick searching thinking that someone had to have done something like this in the past and I was right, someone had and they were using a status change alert. Here is a link to what I found and I set it up and it does work.
I did the alert on state change event and like I said it does work. Just not as good as I would like. It seems to send out a lot of alerts and I think it is due to network Latency. So if it gets a bit behind the state changes and an alert goes out. Well that is great but I would like to verify that we really have an issue before sending out alerts so I am going to have that alert kick off a PS script that will wait about a minute and double check the state of the mirror. If it is still in a failed state then I will send out the notifications.
Thanks and I will post the script when it is complete.