Automatic agent installation - Puppet/Chef

Using Puppet or Chef you can deploy the agent, create a new device, start monitoring and inherit group alerts automatically.

This article is for our v1 agent and will soon be deprecated. See Puppet/Chef for the v2 agent

Set up the API

  1. Log in to your Server Density account.
  2. Click your name in the top left, 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. "Puppet".
  4. Press Enter and your API token will be shown as a 32 character ID.

Chef

Download the official Chef cookbook then set up the configuration:

  • Set node['serverdensity']['token'] to the API token you created above.
  • Set node['serverdensity']['account'] to your full account URL e.g. example.serverdensity.io

Then include recipe[serverdensity::alerts] in a run list. This will install the agent and register it automatically against the API.

Optional config

There are many other config options documented in the Chef recipe for configuring other metrics, setting alerts, etc. One important one is putting the new server into a group automatically by setting node['serverdensity']['device_group'] to a group name. This allows you to configure group level alerts and have new servers inherit those alerts by default.

Puppet

Download our official Puppet manifest. It includes a parametised class to handle the install:

 

class {
        'serverdensity_agent':
            sd_url => 'https://youraccount.serverdensity.io',
            api_token => 'APITOKENHERE',
}

NB: the resulting directory should be named "serverdensity_agent"

This will install the agent and create a new device with monitoring started automatically.

Optional config - group alerts

There are many other optional config options documented in the Puppet manifest for configuring other metrics. One important one is putting the new server into a group automatically. This allows you to configure group level alerts and have new servers inherit those alerts by default.

Set server_group to a group name for the new server to join.

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.