Additional discovery on same class

Hi,

I would like to update a few (cmdb) Properties on Our servers quite frequently. I am planning to use an additional discovery for this, but i havent done that before so if you have any tricks please let me know.

I will have to use script discovery to update the Properties - should i add a New instance in this discovery as well or can they be updated directly?

1 Like

The discovery mechanism in SCOM uses reference counting by comparing the Key properties of discovered instances (and their hosting parents, if hosted) to determine if a new instance should be created or an existing one updated.

Essentially your discovery simply needs to create a class instance with key properties at a minimum and all properties you wish to update. SCOM will see that an instance already exists with the same key properties and hosting hierarchy, and will increase the reference count on the existing instance rather than creating a new one. As long as the ref count is greater than 0, the instance continues to exist.

Omitting any other properties will leave their values as-is (SCOM will merge your new results with the existing set) - including them but leaving them default/blank will cause them to be overwritten (probably not what you want to do).

It’s worth noting if you are updating properties that other discoveries are attempting to set the most recent discovery wins, so make sure you add your information in the same format otherwise it may look confusing (for example, a value keeps flipping between upper and lower case!).

One final word of warning - be careful on how frequently you update these properties. Aside from the overhead on the agent of running discovery modules (especially scripts) on a frequent basis, you can cause some real performance issues to your OpsMgr database, especially if the properties are changing with each discovery (SCOM stores all previous values, if they differ, and stores the entire discovery datagram, not just the single property that changed). Anything more frequently than every 4 hours should be setting off alarm bells.

I forgot the Whole thing, but suddenly it came back today. I havent seen Your reply.thank you for that.

Not sure i understand everything completly, but i can update Properties on the same class directly in a second discovery using
$*******.AddProperty("$MPElement[Name=‘CLASS’]/PROPERTY$", $c.VALUE)

without using

$discoveryData.CreateClassInstance("$MPElement[Name=‘CLASS’]$")

To be Clear. What i am trying to achieve, is to be able to disable monitoring through Our CMDB - IE: i do not want to have cpu monitoring enabled etc. SCOM picks up this change, put it in a Group wich have overrided the monitor.

Just want to clarify - are you updating properties that normally exist on the class, or extending the class (for example, Windows OS) with additional properties that you are then going to use in your group criteria?