Starting the agent via: rhq-agent.sh -l -u -c master-rhq-agent-config.xml -d is currently not possible unless rhq.agent.name is explicitly set in master-rhq-agent-config.xml. I'm thinking we could support -Ddefault.agent.name.to.fqdn=true and/or -Drhq.agent.name=`hostname`
-Drhq.agent.name=`hostname` is too platform specific
I fixed this without realizing this JIRA existed :) svn rev 1867
Here's the relevant code change: if ((m_configuration.getAgentName() == null) || (m_configuration.getAgentName().length() == 0)) { // the agent name isn't defined yet - let's auto-generate one for the user try { String hostname = InetAddress.getLocalHost().getCanonicalHostName(); m_configuration.getPreferences().put(AgentConfigurationConstants.NAME, hostname); m_configuration.getPreferences().flush(); LOG.info(AgentI18NResourceKeys.AGENT_NAME_AUTO_GENERATED, hostname); } catch (Exception e) { throw new IllegalStateException(MSG.getMsg(AgentI18NResourceKeys.AGENT_NAME_NOT_DEFINED), e); } }
QA Verified.
<mazz> -Drhq.agent.configuration-setup=true or whatever the real pref name is I actually never tried that - but, I think it might work the agent accepts -D command line options see rhq-agent.sh --help rhq.agent.configuration-setup-flag that's the real name ah - I got it right the first time : } oh, no I didn't... forgot "-flag"
This bug was previously known as http://jira.rhq-project.org/browse/RHQ-496