| « SCOM grey RMS and agents with 7022 events after deleting crypto folder | SCOM Trick 13 – SPN » |
SCOM Trick 14 – Troubleshoot grey agents or management server
SCOM, SCOM TricksVery often you will see some SCOM agent turn into a grey state. In some cases this can happen to your management server or RMS as well (I hope not!!). This can have several reasons and range from an agent being down or a machine being down to more serious issues.
Normally your first step might be to ping the agent (using the tasks in the actions pane), followed by a check if the agent service is running on the remote computer (System Center Management service).
I have already talked about machines that can turn grey in SCOM Trick 10 and SCOM Trick 11 in case you might be looking at stale data in your console or when a machine actually is not part of SCOM anymore. For instance if somebody turned the machine off at the end of its life cycle. Those pages discuss getting rid of objects that you know are not monitored anymore and you do not want them. Everything below this point I assume you actually do want these objects to be monitored and have a nice and green state (if possible).
How to find grey agents?
In the SCOM console is one place of course.
There is a management pack that will show you alerts for grey agents:
http://www.systemcentercentral.com/tabid/145/indexId/23800/Default.aspx
Combining it with Opalis to find grey agents by Marcus Oh:
http://marcusoh.blogspot.com/2010/09/opalis-monitoring-grey-gray-agents-in.html
Find grey agents in PowerShell:
$WCC = get-monitoringclass -name "Microsoft.SystemCenter.Agent"
$MO = Get-MonitoringObject -monitoringclass:$WCC | where {$_.IsAvailable -eq $false}
$MO | select DisplayName
Find grey agents in SQL:
SELECT ManagedEntityGenericView.DisplayName, ManagedEntityGenericView.AvailabilityLastModified
FROM ManagedEntityGenericView
INNER JOIN ManagedTypeView ON ManagedEntityGenericView.MonitoringClassId = ManagedTypeView.Id
WHERE (ManagedTypeView.Name = 'microsoft.systemCenter.agent') AND (ManagedEntityGenericView.IsAvailable = 0)
ORDER BY ManagedEntityGenericView.DisplayName
Troubleshooting grey agents:
Troubleshooting grey agents KB article KB2288515
Troubleshooting gray agent states in System Center Operations Manager 2007 and System Center Essentials
http://support.microsoft.com/kb/2288515
This is a very complete discussion on the subject.


Lot of thanks because all your support with the community
I have one question, is it possible to make a view in SCOM that just includes the agents with grey status?
It is in order that the operators could easily detect this kind of agents without running PS or SQL commands
You can take the powershell piece and see if you can put it in a task. The operators can run the task from the action pane on the right.
The SQL command can be used to create a report which can be run from the SCOM console or could be scheduled and sent as pdf to the email address of the operators.
I thought your article was great but I think there was an issue with the PowerShell portion.
In the SCOM 2012 Powershell Module the cmdlets for SCOM have SCOM at the beginning of the noun portion.
So your example for PowerShell needs to be changed to:
Get-SCOMMonitoringClass
Get-SCOMMonitoringObject