Preconfiguring the AgentWhen the agent starts up, it will prompt you for some initial configuration preference values. If you want to prepackage your own agent distribution with a custom set of preset configuration preferences, you can edit agent-configuration.xml (located in any agent's /conf directory) and set all the preferences to your own values. Doing this will allow a new agent to start up without asking the setup questions on the console. This allows you to deploy agents without requiring administrators to manually answer the setup questions, providing the ability for more automated agent installs. Preparing the Agent ConfigurationTo make sure an agent knows it is already preconfigured and does not have to prompt the user the first time it starts up, edit a agent-configuration.xml and be sure to set the configuration preference rhq.agent.configuration-setup-flag to "true". When this is true, the agent will assume it is fully configured and will not ask setup questions when it starts up. (note that you may wish to distribute agent configuration files with only a subset of configuration preferences set and rely on each agent's startup setup mechanism to finish its configuration - in this case, you'll want to leave this as false and let the user fill in the remaining configuration preference values then; of course, this still requires an administrator to answer the setup questions at the console) You can not set rhq.agent.configuration-setup-flag to true if the agent's fully qualified domain name can not be determined. This is typically not an issue but it should be noted that the FQDN will be used as the agent name in this type of preconfigured installation. You can not set rhq.agent.configuration-setup-flag to true if the agent's default IP address is not reachable by the RHQ Server (or all of the servers in a RHQ High Availability cloud). The agent's default IP address will be the default value used for the agent public endpoint that all RHQ Servers will use to communicate with the agent. Note that the following properties found in agent-configuration.xml define the RHQ Server to be contacted by the RHQ Agent when it needs to perform its initial registration. These must be preconfigured appropriately in agent-configuration.xml:
The following property defines the agent endpoint port and must be set appropriately in agent-configuration.xml if the default of port 16163 is not to be used:
The agent-configuration.xml is fully commented and can be inspected for a variety of other configuration options (e.g. secure SSL communications among other things). Building Your Own Preconfigured Agent BundleAfter you have preconfigured a agent-configuration.xml for all of your agents to use, you need to bundle it into what is known as a "agent update binary". Out-of-box, the RHQ Server already comes with the standard agent update binary (one that is not preconfigured). You have the option of preconfiguring the agent update binary. Once the RHQ Server has your preconfigured agent update binary, everyone who gets the agent from your RHQ Servers will get your preconfigured agents. To preconfigure the agent update binary is conceptually very simple. You simply overwrite the default agent-configuration.xml file that comes with the agent update binary with your own. But because this .xml file is buried inside the agent update binary jar, it takes a few steps to do this:
At this point, your new preconfigured agent update binary is ready for download from the RHQ Server. When you install your RHQ Agent, it will have your preconfigured settings.
|