This metric is described in Grant Fritchey’s Custom Metrics for monitoring mirroring article on Simple Talk.
With this metric installed, you’ll know from a single value what the current status of your mirroring system is. It can be used to check for changes in the environment, for example, if a mirror goes from synchronized to pending failover, or if the there’s an error situation that causes the server to disconnect.
Important setup information
Before you can start using this metric, you need to:
- Run the following Microsoft procedure on the msdb database you’ll use in the custom metric:
USE msdb; GO EXEC sp_dbmmonitoraddmonitoring; GO
This sets up a SQL Agent job that periodically updates information about the mirrored databases on your server. For more information, see http://msdn.microsoft.com/en-us/library/ms403582.aspx.
- Make sure the SQL Agent is configured and running on the server. Then you can retrieve information using the sp_dbmmonitorresults procedure.