3 Replies Latest reply on Sep 17, 2010 1:18 PM by flsusp-br

    Monitoring JBoss instances on Amazon EC2

    flsusp-br

      I have a cluster configured on Amazon EC2 Cloud but I am having trouble to configure my volatile JBoss instances on RHQ. Basically I did the following:
      1) I created an image of my default JBoss instance machine with the JBoss and RHQ Agent;
      2) On a new machine startup there is a script that changes the agent bind address that is configured on $HOME/.java/.userPrefs/rhq-agent/default/prefs.xml (file generated by the RHQ Agent setup). It changes also the property "rhq.agent.name" to something like "backend-${bindAddress}" (cause I have another cluster that we call "frontend"). As each machine has a different IP/Bind Address, there should be no issues for the RHQ server;
      When I start the a new machine, automatically starting the RHQ Agent, the agent is correctly registered on the RHQ Server, but with the wrong agent name. The name registered maches the hostname of the new machine. I want it to match the name on the configuration file, for organization purposes. There is something I'm missing?
      I'd like also to remove some servers from the Auto-Inventory. There is some way to do this?
      Thanks,
      Fábio.

      I have a cluster configured on Amazon EC2 Cloud but I am having trouble to configure my volatile JBoss instances on RHQ 3.0.0. Basically I did the following:

       

      1) I created an image of my default JBoss instance machine with the JBoss and RHQ Agent;

      2) On a new machine startup there is a script that changes the agent bind address that is configured on $HOME/.java/.userPrefs/rhq-agent/default/prefs.xml (file generated by the RHQ Agent setup). It changes also the property "rhq.agent.name" to something like "backend-${bindAddress}" (cause I have another cluster that we call "frontend"). As each machine has a different IP/Bind Address, there should be no issues for the RHQ server;

       

      When I start the a new machine, automatically starting the RHQ Agent, the agent is correctly registered on the RHQ Server, but with the wrong agent name. The name registered maches the hostname of the new machine. I want it to match the name on the configuration file, for organization purposes. There is something I'm missing?

       

      I'd like also to remove some servers from the Auto-Inventory. There is some way to do this?

       

      Thanks,

       

      Fábio.

        • 1. Re: Monitoring JBoss instances on Amazon EC2
          goldmann

          Hi Fabio,

           

          I think you need to change $RHQ_AGENT_HOME/conf/agent-configuration.xml file and adjust rhq.agent.name and rhq.agent.server.bind-address property to fit your needs.

           

          Then you'll need to restart your agent adding the --cleanconfig option to RHQ_AGENT_CMDLINE_OPTS.

           

          Answering your 2nd question – it should be possible to use RHQ CLI to do this, but I haven't tried it yet.

           

          HTH

           

          --Marek

          • 2. Re: Monitoring JBoss instances on Amazon EC2
            john.sanda

            Like Marek said, you can override defaults easily by setting the RHQ_AGENT_CMDLINE_OPTS environment variable. You might do something like,

             

            $ export RHQ_AGENT_CMDLINE_OPTS="-Drhq.agent.server.bind-address=my.server.address -Drhq.agent.name=my.agent.name"

             

            Also note that if you do set the environment variable and if you intend to run the agent with rhq-agent-wrapper.sh then you will also need to specify --daemon in RHQ_AGENT_CMDLINE_OPTS.

             

            To remove resources from inventory in a CLI script, you can call ResourceManager.uninventoryResources(resourceIds) where resourceIds is an array of the resource ids. Keep in mind that after removing resources from inventory they can show back up in your discovery queue. If you no longer care about those resources you could subsequently call DiscoveryBoss.ignoreResources(resourceIds).

             

            - John

            • 3. Re: Monitoring JBoss instances on Amazon EC2
              flsusp-br

              It worked! Thanks