SCOM-Agent Failover

Operations Manager is the monitoring component from the System Center suite. Honestly one of the best and broadest monitoring solutions I saw so far. There is a ton of product knowledge inside the management packs. I’m using SCOM now for a while and based on my experience the most important rule when it comes to monitoring be sure you read the management pack guides Smile Next is to tune and tweak the management packs to your specifics.

Agents do have by nature ability to failover if you have SCOM large deployment where more than 1 management / gateway server exists. in case you have regional requirements you can configure the failover based on your needs

How to configure Gateway Failover?

#Set all Gateway Servers to use PRI_MS and Primary and FAILOVER_MS as Failover
$primaryMS = Get-SCOMManagementServer | where {$_.Name –match "SCOMMS1"}
$failoverMS = Get-SCOMManagementServer | where {$_.Name –match "SCOMMS1"}
$gatewayMS = Get-SCOMManagementServer | where {$_.IsGateway -eq $true}
Set-SCOMParentManagementServer -GatewayServer: $gatewayMS -PrimaryServer: $primaryMS
Set-SCOMParentManagementServer -GatewayServer: $gatewayMS -FailoverServer: $failoverMS

How to configure Agent Failover?

#Agents reporting to "SCOMGATEWAY1.DOMAIN.COM" – Failover to "SCOMGATEWAY2.DOMAIN.COM"
$primaryMS = Get-SCOMManagementServer | where {$_.Name –eq "SCOMGATEWAY1.DOMAIN.COM"}
$failoverMS = Get-SCOMManagementServer | where {$_.Name –eq "SCOMGATEWAY2.DOMAIN.COM"}
$agent = Get-SCOMAgent | where {$_.PrimaryManagementServerName -eq "SCOMGATEWAY1.DOMAIN.COM"}
Set-SCOMParentManagementServer -Agent: $agent -PrimaryServer: $primaryMS
Set-SCOMParentManagementServer -Agent: $agent -FailoverServer: $failoverMS

How to verify?

#Verify Failover for Agents reporting to "SCOMGATEWAY1.DOMAIN.COM"
$Agents = Get-SCOMAgent | where {$_.PrimaryManagementServerName -eq "SCOMGATEWAY1.DOMAIN.COM"}
$Agents | sort | foreach {
Write-Host "";
"Agent :: " + $_.Name;
"–Primary MS :: " + ($_.GetPrimaryManagementServer()).ComputerName;
$failoverServers = $_.getFailoverManagementServers();
foreach ($managementServer in $failoverServers) {
"–Failover MS :: " + ($managementServer.ComputerName);
Write-Host "";