How to Enable the DigitalOcean Agent

To enable extended metrics and other DigitalOcean Monitoring features, you need to install the Agent on your Droplet. This can be done automatically during the Droplet creation or manually at any time.

Enabling the Agent During Droplet Creation

To install the Agent during Droplet creation, select the Monitoring checkbox in the additional options section of the creation page:

Select monitoring

The Agent will be automatically installed and enabled during the Droplet creation process.

If you are using the DigitalOcean API to create Droplets, you can set the monitoring attribute to true in the creation parameters to automatically install the Agent on the Droplet during creation. The Droplet creation section of the API documentation contains additional details.

Installing the Agent Manually

You can also install the Agent manually. There is an installation script available that automatically detects the client operating system and configures repositories to install the agent. If you are uncomfortable running an installation script, you can set up your repositories manually.

With an Installation Script

An installation script is available to install the Agent manually. The script will add a repository to your system and use the native package manager to install the Agent. This simplifies package management tasks like upgrading or removing the Agent.

Log into your Droplet as root or as a user with sudo access:

ssh root@203.0.113.0

Once connected, to install and enable the Agent immediately, you can download and execute the installation script by typing:

curl -sSL https://agent.digitalocean.com/install.sh | sh

You may be prompted for your password if running as a sudo user.

If you would like to audit the script before installing, you can write it to disk first:

curl -sSL https://agent.digitalocean.com/install.sh -o /tmp/install.sh

View the contents by typing:

less /tmp/install.sh

When you are satisfied with the installation procedure, run the script by typing:

sh /tmp/install.sh

The agent should now be installed and running.

Configuring Repositories Manually

You can also add the repositories and install the package manually if you prefer.

Ubuntu and Debian

To add the Agent repository, create and open a file in the /etc/apt/sources.list.d directory with sudo privileges:

sudo nano /etc/apt/sources.list.d/digitalocean-agent.list

Inside, add the following line:

deb https://repos.sonar.digitalocean.com/apt main main

Save and close the file.

Next, add the DigitalOcean key to apt by typing:

curl https://repos.sonar.digitalocean.com/sonar-agent.asc | sudo apt-key add -

Now you can update the repository package index and install the Agent by typing:

sudo apt-get update
sudo apt-get install do-agent

The agent should now be installed and running.

CentOS

On CentOS, create and open a repository definition file with sudo privileges:

sudo vi /etc/yum.repos.d/digitalocean-agent.repo

Inside, paste the following configuration:

[sonar]
name=do agent
baseurl=https://repos.sonar.digitalocean.com/yum/$basearch
failovermethod=priority
enabled=1
gpgcheck=1
gpgkey=https://repos.sonar.digitalocean.com/sonar-agent.asc

Import the DigitalOcean key by typing:

sudo rpm --import https://repos.sonar.digitalocean.com/sonar-agent.asc

Now, you can install the Agent by typing:

sudo yum install do-agent

The agent should now be installed and running.

View the Enhanced Graphs

Once the Agent is enabled, click the Droplet’s name, which takes you to the Graphs section of your Droplet’s detail page. The extended metrics will be available once your Agent checks in, which may take a moment:

Droplet extended metrics

Use the drop-down menu to adjust the time window displayed and mouse over the graphs to view detailed information.