Archive for the ‘SQL Queries’ Category

Decommissioned Servers still appearing in console

March 29, 2010 Leave a comment

More great information from Kevin Holman posted originally on the technet forums.

If you delete an agent via agent managed – and yet you still see a Windows Computer object for it…. then this means:

1. It hasnt groomed out yet or hasnt been marked as deleted. Wait a few days.

2. A discovery is still associated with this managed object.

To determine which discoveries are still associated with a managed object that you expect to be deleted:

To determine what discoveries are still associated with a computer – helpful in finding old stale computer objects in the console that are no longer agent managed, or desired.

select BME.FullName, DS.DiscoveryRuleID, D.DiscoveryName from typedmanagedentity TME
Join BaseManagedEntity BME ON TME.BaseManagedEntityId = BME.BaseManagedEntityId
JOIN DiscoverySourceToTypedManagedEntity DSTME ON TME.TypedManagedEntityID = DSTME.TypedManagedEntityID
JOIN DiscoverySource DS ON DS.DiscoverySourceID = DSTME.DiscoverySourceID
JOIN Discovery D ON DS.DiscoveryRuleID=D.DiscoveryID
Where BME.Fullname like ‘%ComputerName%’

change computername to yours.

Categories: SQL Queries

Date Last Contacted

March 29, 2010 Leave a comment

I keep losing track of this one so I’m adding it my own blog!

Categories: SQL Queries

Find a Custom Rule that is causing a problem

March 29, 2010 Leave a comment

You can tell if a rule is a custom rule – the description will include the parameter “MOMUIGeneratedRule”

If a custom rule is causing a problem, you can run the following script against the operationsmanager database:

select *
from rules r
join managementpack mp
on r.managementpackid = mp.managementpackid
where r.rulename like ‘%MomUIGeneratedRulee8c779c3eb7f43e18da1e5a0cdf23c4%&’

This will give you details about the rule so that you can troubleshoot it.

Categories: SQL Queries