Home > OM12 Powershell, Operations Manager 2012 > How to remove objects from monitoring (Remove-SCOMDisabledClassInstance)

How to remove objects from monitoring (Remove-SCOMDisabledClassInstance)

This is an update to several blog posts I’ve seen for SCOM 2007, updated for SCOM 2012.

Questions normally seen on TechNet forums would be similar to this: I have a server that I’m monitoring, however I do not want to monitor SQL 2008 on this server for XYZ reason. Enter the SCOM 2012 cmdlet Remove-SCOMDisabledClassInstance. This cmdlets job is to delete all class instances for which a discovery has been disabled by using an override. All the relationships that involve these class instances are also deleted. This task can be database intensive, if manipulating large numbers of computer objects.

First figure out which management pack you will be working with. In the example above we are going to remove monitoring of SQL Server 2008 from a specific server. Using the SCOM 2012 Management Pack Viewer open up the SQL Server 2008 (Discovery) management pack. Click the discoveries option then take a look for a seed discovery. In this example it is the SQL Server 2008 DB Installation Discovery Source.

_sql2008discovery

Armed with the name of the Discovery/Class we are looking for, open up the OpsMgr console, and click the Authoring tab, and expand the Management Pack Objects and select the Object Discoveries. Click change scope and type SQL in the Look for box, and select the SQL Server 2008 Installation Seed target, then click OK.

_sqlTarget

Right click on the SQL Server 2008 DB Installation Discovery Source, and select Overrides > Override the Object Discovery > For a specific object of class: Windows Server, then select the specific server name that you want to un-discover SQL on.

Then open the Operations Manager PowerShell console, and run the cmdlet Remove-SCOMDisabledClassInstance, confirm to run it and your done. The objects should be removed shortly.

 

If you were planning on doing this on a group of servers, create a group of servers that would need to be stored in the SQL Server 2008 (Monitoring) – Override management pack, so the group would be visible to the override. The membership of this group needs to be made up of Windows Server objects. Right click on the SQL Server 2008 DB Installation Discovery Source, and select Overrides > Override the Object Discovery > For a group, then select the specific group that you want to un-discover SQL on.

Then open the Operations Manager PowerShell console, and run the cmdlet Remove-SCOMDisabledClassInstance, confirm to run it and your done. The objects should be removed shortly.

If you want to keep the server from ever being discovered just leave the override in place.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: