First Plugin: Discovery

John Mazzitelli mazz at redhat.com
Tue Dec 15 13:25:27 UTC 2009


>>> 1) When new software is installed, how does the version information get
>>> updated? Do you have to re-run discovery on regular intervals?

>> Yep, discovery reports the current version. Discovery does run
>> periodically - once per hour for server scans and once per day for
>> service scans. For a Resource that is already committed into Server
>> inventory, if the version has changed from its previous value, the
>> plugin container notifies the Server that the version has changed for
>> that Resource.

> So as long as the ID is the same, all is good.. correct?

To be more technically accurate, you would say "as long as the *resource 
key* is the same. The resource *key* is not the same as the resource ID 
- in fact, the plugin developer never knows what the official resource's 
surrogate primary key (aka ID) is - the plugin dev only ever works with 
the canonical resource key.

The resource key is unique among its peers, but not necessarily unique 
across the entire inventory (i.e. all resources that have the same 
parent must have unique keys, but resources with different parents need 
not be unique). For example, network adapters that are children to a 
single platform resource must have unique names (eth0, eth1), but of 
course we can have multiple network adapters in the inventory that are 
named "eth0" because they are on different platforms.

See the plugin dev docs, specifically here:

http://rhq-project.org/display/RHQ/Writing+Custom+Plugins#WritingCustomPlugins-Identity


More information about the rhq-devel mailing list