This metric is described in Grant Fritchey’s Custom Metrics for monitoring mirroring article on Simple Talk.
The metric returns the current role of a given database within your mirroring set up. The single value returned tells you whether the database is the principal or the mirror, which is important information if you always want one server to act as the principal.
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.