次の方法で共有


So what about diagnostics and recoveries?

Another new capability in OpsMgr is being able to execute diagnostics and recoveries as reactions to monitor state changes. The OpsMgr MP defines a number of diagnostics to keep the agents healthy and repair them if need be. Here is a powershell script that will shed some light on what diagnostics and recoveries exist in your installation:

Diagnostics:  

$mgConnection = (Get-ManagementGroupConnection).ManagementGroup

$diagnostics =  $mgConnection.GetMonitoringDiagnostics()

$diagnostics | select-object DisplayName,ExecuteOnState,@{name="Monitor";expression={foreach-object {$mgConnection.GetMonitor($_.Monitor.Id).DisplayName}}},@{name="MP";expression={foreach-object {$_.GetManagementPack().DisplayName}}} | sort DisplayName | fl

Recoveries:  

$mgConnection = (Get-ManagementGroupConnection).ManagementGroup

$recoveries =  $mgConnection.GetMonitoringRecoveries()

$recoveries | select-object DisplayName,ExecuteOnState,@{name="Monitor";expression={foreach-object {$mgConnection.GetMonitor($_.Monitor.Id).DisplayName}}},@{name="Reset Monitor";expression={foreach-object {$_.ResetMonitor}}},@{name="MP";expression={foreach-object {$_.GetManagementPack().DisplayName}}} | sort DisplayName | fl

Comments