Automatic agent installation - shell script / API

Using our official installer shell script connected to our API, you can automatically install the agent and have it create the device in your account. You can also specify a group to automatically inherit group alerts.

Create an API token

  1. Log in to your Server Density account.
  2. Click your name in the top right, then click Preferences.
  3. Go to the Security tab then in the bottom right, enter a name for the API application you're building so you can easily recognise it in the future e.g. "install.sh".
  4. Press Enter and your API token will be shown as a 32 character ID.

Execute the script

Download the installer script and then execute with your account name, the API token you created above and, optionally, a group name to create the device in: 

curl http://archive.serverdensity.com/agent-install.sh | bash -s -- -a ACCOUNT -t API_TOKEN

If you have already created the device in Server Density, you can pass the agent key without the API token:

curl http://archive.serverdensity.com/agent-install.sh | bash -s -- -a ACCOUNT -k AGENT_KEY

Optional arguments can be passed to group the device, assign a tag or associate it with a server imported using cloud provider sync.

 -g: Group to add the new device into.
 -T: Tag this device - multiple tags not supported.
 -p: Hosting provider (e.g. amazon)
 -i: Provider ID (requires provider). Cloud device ID (instance ID for EC2 devices)
 -A: Automatically get the Amazon Web Services instance ID and provider
 -G: Automatically get the Google Cloud instance id and provider 
Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request

Comments

Monday  —  Friday.

10am  —  6pm UK.

Dedicated Support.