Hi there,
There is a PowerShell cmdlet built-in to Exchange 2010 that tests various aspects of a DAG (Database Availabilty Group). It would be excellent if an APM component monitor could execute this cmdlet. I have already tried having a go at creating this monitor using one of the existing APM Exchange PS scripts but I quickly got out of my depth!
Basically the cmdlet is this:
Test-ReplicationHealth mbx-1
This will execute the Test-ReplicationHealth against a mailbox DAG node and return the results of various tests that the cmdlet carries out.
If all is well the output will be like this:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[PS] C:\Windows\system32>Test-ReplicationHealth mbx-1
Server Check Result Error
------ ----- ------ -----
MBX-1 ClusterService Passed
MBX-1 ReplayService Passed
MBX-1 ActiveManager Passed
MBX-1 TasksRpcListener Passed
MBX-1 TcpListener Passed
MBX-1 DagMembersUp Passed
MBX-1 ClusterNetwork Passed
MBX-1 QuorumGroup Passed
MBX-1 FileShareQuorum Passed
MBX-1 DBCopySuspended Passed
MBX-1 DBCopyFailed Passed
MBX-1 DBInitializing Passed
MBX-1 DBDisconnected Passed
MBX-1 DBLogCopyKeepingUp Passed
MBX-1 DBLogReplayKeepingUp Passed
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
So when I had a go at making the component monitor I figured it would be better to run the script and only have it output something if there was a problem. Something like stat 0 for no output (good) and stat 1 if there is any kind of output (bad).
The cmdlet that only outputs something if there's something wrong is this:
Test-ReplicationHealth mbx-1 | ? { $_.Result.ToString() -ne "Passed" }
Can anyone help with converting this into a template?
More info on the cmdlet here:
http://technet.microsoft.com/en-us/library/bb691314.aspx
http://technet.microsoft.com/en-us/library/dd351258.aspx
Many thanks,
Graham