Description of problem: Because service scans are normally very expensive to perform the service scan frequency is set to 24 hours by default and we can't down it a lot. So it will be usefull to be able to launch a service scan for a particular resource only. For example using --resourceId combined with discovery command from agent prompt. Actual results: not possible Expected results: launch service scan on that resource
git commit 05f3a00fae75d97d066559c7671dc4f0770a1dbd allows a user to enter --resourceId option to discovery prompt command in order to perform a service scan: discovery --verbose --resourceId=10013 Like the rest of the options of this command (exception being --ful) this new feature still will not send up an inventory report to the RHQ Server - you use --full for that. This --resourceId is to assist developers while they are writing plugins to test service scans or allows users to see what the next service scan would detect. Since service scans are scheduled every 24 hours by default, this helps people see if any services can be found without waiting the 24 hour cycle to repeat - if something is discovered using this command, you can do a "discovery --full" to force a full discovery to be performed and the inventory report sent up to the server. IIRC, due to the nature of the code and the inventory discovery workflow, its not trivial to get a partial inventory report to make its way to the server and have the agent inventory get populated. That's why this --resourceId performs a "detached discovery" (i.e. the report is just printed to the console and not sent up to the server). "discovery --full" is the only way to force the report to get sent to the server; that works because its actually doing the full server/service scan workflow, rather than just a partial scan.
Verified on RHQ-Master build #442 http://hudson-qe.rhq.rdu.redhat.com:8080/view/RHQ/job/ci-rhq-master/442/ Observation: discovery --verbose --resourceId=<RESOURCE_ID> This works fine to scan specific service. > discovery --verbose --resourceId=10003 Service discovery run for resource [dhcp1-1.pnq.redhat.com RHQ Server] === Service Scan Inventory Report === Start Time: Oct 22, 2010 3:12:06 PM Finish Time: Oct 22, 2010 3:12:06 PM Resource Count: 272 Resource: Resource[id=10003, type=JBossAS Server, key=/data/jon/build/rhq442/rhq-server-4.0.0-SNAPSHOT/jbossas/server/default, name=dhcp1-1.pnq.redhat.com RHQ Server, parent=dhcp1-1.pnq.redhat.com, version=4.2.3.GA]
Bookkeeping - closing bug - fixed in recent release.