Wednesday 23 February 2011

Operations Manager (SCOM) 2007 - How to remove cluster objects from scom when computer objects in cluster cannot be deleted

This is variation of previous posts like these ones I just use remove-disabledmonitoringobject for the last steps which I think is safer.

Find agentless objects in agentless managed view. In our case they were cluster computer names and had a class of ‘windows computer’ and name = fqdn of the cluster server name. (not the two servers that hosted it). The agent machines were already decom but couldn’t be deleted from scom. The proxy agent pointed at a node we were trying to delete but couldn’t

In sql find it in bme table by query
SELECT     BaseManagedEntityId, BaseManagedEntityInternalId, BaseManagedTypeId, FullName, Path, Name, DisplayName, TopLevelHostEntityId, IsManaged,
                      IsDeleted, LastModified, OverrideTimestamp
FROM         BaseManagedEntity
WHERE     (Name LIKE '%CLUSTERXYZ%') AND (FullName LIKE '%Computer%')
ORDER BY FullName

Copy the FIRST column BaseManagedEntityID e.g
fc798482-69b4-d04c-642f-93f1c8d80b8b

run a select by ID to be 900% certain you have the right object
SELECT * FROM dbo.[BasemanagedEntity] where
BaseManagedEntityID='fc798482-69b4-d04c-642f-93f1c8d80b8b'

You should get 1 result with correct looking name etc.

Then run the update query to make scom think it is deleted
BE INSANELY CAREFUL RUNNING THIS QUERY – SCREW UP THE WHERE CLAUSE AND YOU WILL DESTROY SCOM. MAKE SURE THE UPDATE CAN ONLY TARGET THE ONE OBJECT THAT IS VALID
UPDATE dbo.[BasemanagedEntity]
SET IsDeleted = 1
where BaseManagedEntityID='fc798482-69b4-d04c-642f-93f1c8d80b8b'

now refresh ‘agentless managed’ and problem object should have disappeared. Repeat this for any invalid clusters that still appear in agentless managed.
Now it will let you delete the agent’s machines from the cluster in agent managed view.

Open command shell and run this to clean up any mess.
Remove-DisabledMonitoringObject

This will find all the cluster class child objects and make them ‘is deleted’ etc. Some posts have this as a manual step with more db updates of multiple objects in BME table but I think this way is safer.

At this point the clusters should disappear from 'monitoring' views.

No comments:

Post a Comment