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?
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.