-
1. Re: Any way to create alert on the discovery of new servers?
john.sanda Jul 18, 2013 7:07 AM (in response to pathduck)Hi Stian,
I am not aware of any such capability but this would make for a good feature request. RHQ auto imports storage nodes and their host platforms. There have been some discussions about how we might generalize this functionality to make it available to other resource types. Feel free to write a feature request at https://bugzilla.redhat.com/enter_bug.cgi?product=RHQ%20Project.
-
2. Re: Any way to create alert on the discovery of new servers?
john.sanda Jul 18, 2013 7:21 AM (in response to john.sanda)You can see short CLI script[1] I posted some time ago that could be useful. A better version could probably be written using the rhqapi[2] JavaScript module. With this you could set up a cron job to periodically poll the discovery queue.
[1] http://johnsanda.blogspot.com/2010/08/auto-import-resources-into-inventory.html
[2] https://github.com/rhq-project/samples/blob/master/cli/rhqapi/examples/resources.js
-
3. Re: Any way to create alert on the discovery of new servers?
pathduck Jul 18, 2013 8:27 AM (in response to john.sanda)Thanks John.
I kind of figured there was no simple way to do it at the moment - it would be great if for instance there were some things you could create alerts for at the RHQ Server or Agent level.
For instance "if discovery queue != 0 send an email with resource list". I might create an ER but it would be good to know what to actually ask for - would this be in the server or the agent for instance?
Thanks for the examples though. What I would want is to just alert when resources are in the queue - not autoimport them. The API is probably the way to go - but I am unsure if resources are actually in the inventory before they are imported, and hence you could not use the API to query them?
-Stian
-
4. Re: Any way to create alert on the discovery of new servers?
pilhuhn Jul 18, 2013 8:38 AM (in response to pathduck)They are in the inventory.
You can e.g. query for them in the REST-api with the "New" state. See e.g. org.rhq.modules.integrationTests.restApi.ResourcesTest#testResourceQueryNewStatus