[Hawkular-dev] how to use the installer from command line

John Mazzitelli mazz at redhat.com
Wed Jan 13 17:26:43 EST 2016


I'm just sending this to document it for myself :) but this could be useful to others...

This is a quick way you can download the agent installer and install it in a WildFly server instance from a console:

1) Download the installer from a running Hawkular instance, using curl's --user option to pass in the Hawkular credentials:

   curl --user jdoe:password --data 'managed-server-name=YourManagedServerName&username=jdoe&password=password' --remote-name --remote-header-name --url http://localhost:8080/hawkular/wildfly-agent/installer

This connects to the Hawkular Server with the --user credentials and downloads a pre-configured installer and stores it under the file name "hawkular-wildfly-agent-installer.jar" (that's what --remote-name and --remote-header-name magically does). When you run the installer, it will install an agent that will connect to Hawkular using jdoe/password credentials as specified by username=X&password=X (those credentials are stored inside the installer; there is a way to ask the installer to encrypt those credentials so it isn't stored in plain text, but I won't get into that here). It will use the name "YourManagedServerName" when identifying WildFly resources that it stores in inventory (see managed-server-name=)

To run the installer, get the absolute directory name of your installed WildFly server where you want the agent installed (for example: /opt/wildfly) and pass that in as a command line option to the installer like this:

java -jar hawkular-wildfly-agent-installer.jar --target-location=/opt/wildfly

That's it. Your agent is installed. Next time you run that WildFly instance, the agent should run, connect to Hawkular Server, and begin monitoring and reporting inventory.

There is more that can be done. I won't get into details here but you can download the installer with that target-location already preconfigured (if your agents are all stored in the same location like /opt/wildfly, it might be easier to just preconfigure the installer to always use that and not have to pass it in each time when executing the installer). You can encrypt the passwords so they are stored in the installer in an encrypted form. You can use hawkular-account tokens rather than username/passwords for the agent (so the agent can connect to hawkular server using a token and not a user/pass). You can have the agent disabled by default when installed in case you don't want it running yet. You can define SSL credentials if you want the agent to talk to hawkular server over SSL/https. The installer can be configured in all these ways either when you download or even afterwards (you can pass in your own installer configuration file so customize it however you want).



More information about the hawkular-dev mailing list