Navigation

Install or Update the Monitoring Agent with deb Packages

Important

This page describes how to install the agent manually. The easier way to install and run the Monitoring Agent is through Automation, as described in Install or Update the Monitoring Agent through Automation.

The Ops Manager Monitoring Agent is a lightweight component that runs within your infrastructure, connects to your MongoDB processes, collects data about the state of your deployment, and then sends the data to Ops Manager, which processes and renders this data. The agent initiates all connections between the agent and Ops Manager, and communications between the agent and Ops Manager are encrypted.

A single agent can collect data for your entire deployment. You can run multiple agents to distribute assignments and to provide agent failover.

This tutorial guides you through the steps necessary to install or update the Monitoring Agent on your system. You must install the Ops Manager itself before installing the Monitoring Agent.

See Monitoring FAQs for additional information.

Considerations

Connectivity

You must configure the network infrastructure of your deployment so that:

  • the Monitoring Agent can connect to all mongod and mongos instances that you want to monitor.
  • the Monitoring Agent can connect to Ops Manager on port 8080 if it is using HTTP or 8443 if it is using HTTPS.

Ops Manager does not make any outbound connections to the agents or to MongoDB instances. If Exposed DB Host Check is enabled, Ops Manager will attempt to connect to your servers occasionally as part of a vulnerability check.

Ensure all mongod and mongos instances are not accessible to hosts outside your deployment.

Multiple Monitoring Agents

You can run multiple Monitoring Agents to distribute monitoring assignments and provide failover. Ops Manager distributes monitoring assignments among up to 100 running agents. Each agent monitors a different set of MongoDB processes. One Monitoring Agent per project is the primary agent. The primary agent reports the cluster’s status to Ops Manager. As agents are added or shut down, Ops Manager redistributes assignments. If the primary agent fails, Ops Manager assigns another agent to be the primary agent.

Important

To distribute monitoring assignments among multiple Monitoring Agents, you must use Monitoring Agent version 5.0.0 or higher.

If you run more than 100 Monitoring Agents, the additional agents run as standby agents. A standby agent is completely idle, except to log its status as a standby and periodically ask Ops Manager if it should begin monitoring.

For versions of the Monitoring Agent earlier than version 5.0.0, only one agent handles monitoring assignments. All other running agents are standby agents.

To tune the frequency at which standby agents check to see if they should begin monitoring and the interval Ops Manager uses to determine if a standby agent should start monitoring, see Monitoring Agent Session Failover.

If you install multiple Monitoring Agents, ensure that all the Monitoring Agents can reach all the mongod processes in the deployment.

To install multiple agents, simply repeat the installation process.

Collection Interval

If a Monitoring Agent is abruptly stopped, without using an appropriate stop command, Ops Manager will wait 5 minutes before redistributing that agent’s monitoring assignments, which means there can be up to a five-minute delay before another Monitoring Agent begins collecting data and sending pings to Ops Manager. During this interval, the restarted Monitoring Agent will not collect data.

Prerequisite

Access Control

If your MongoDB deployment enforces access control, you must create a user in MongoDB with the appropriate access. See Configure Monitoring Agent for Access Control.

Install the Monitoring Agent with a deb Package

Use this procedure to install the agent on Ubuntu with deb packages.

For Debian systems, instead use the Install or Update the Monitoring Agent from Archive procedure.

You can also access install instructions in Ops Manager, including commands you can copy and paste: click Deployment, then Agents, then Downloads & Settings.

1

Login to Ops Manager.

2

Begin or Manage a Deployment

  1. Click Build New or Manage Existing to begin the deployment wizard. When you reach the Install an Automation Agent on each server page, all hosts are listed.
  2. Click on the Install Agent menu of the first MongoDB host.
  3. Select Ubuntu<version> - DEB.
3

Download the latest version of the Monitoring Agent package.

On a system shell, issue a curl command to download the deb for the agent that works on your platform:

Note

Replace <OpsManagerHost:Port> with the hostname and port of your Ops Manager installation.

For Ubuntu 15.04+ or 16.04+ on x64 architecture:

curl -OL https://<OpsManagerHost:Port>/download/agent/monitoring/mongodb-mms-monitoring-agent_latest_amd64.ubuntu1604.deb

For Ubuntu 16.X on PowerPC architecture:

curl -OL https://<OpsManagerHost:Port>/download/agent/monitoring/mongodb-mms-monitoring-agent_latest_ppc64e1.ubuntu1604.deb

For Ubuntu 14.04+ on x64 architecture:

curl -OL https://<OpsManagerHost:Port>/download/agent/monitoring/mongodb-mms-monitoring-agent_latest_amd64.deb
4

Install the Monitoring Agent package.

To install the agent that works on your platform, issue the appropriate command to install the package:

For Ubuntu 15.04+ or 16.04+ on x64 architecture:

sudo dpkg -i mongodb-mms-monitoring-agent_latest_amd64.ubuntu1604.deb

For Ubuntu 16.X on PowerPC architecture:

sudo dpkg -i mongodb-mms-monitoring-agent_latest_ppc64e1.ubuntu1604.deb

For Ubuntu 14.04+ on x64 architecture:

sudo dpkg -i mongodb-mms-monitoring-agent_latest_amd64.deb
5

Generate an agent API key or retrieve an existing agent API key for your Ops Manager project.

  1. Click + Generate Key.

Note

The button appears only if the current user is the project owner and the project either has no Agent API keys or just the Original Group API key. An Original Group API key exists only in projects created prior to the new Agent API Key model. The new model allows a project to have more than one key and permits any of the project’s agents to use any of the keys. For more information, see Manage Agent API Keys. If you do not see the + Generate Key button and do not remember your existing agent api key, you can generate a key on the Agent API Keys tab. To navigate to the tab, select Deployment view, then click the Agents tab and then the Agent API Keys tab.

  1. Enter your password and click Verify.
  2. Click + Generate Key again.

Important

When you generate an Agent API key, Ops Manager displays it one time only. You must copy it and store it in a secure place. Ops Manager will never display the full key again.

6

Edit the monitoring-agent.config file to include your Project ID and agent API key.

Edit the /etc/mongodb-mms/monitoring-agent.config file.

For mmsGroupId, enter your Project ID.

For mmsApiKey, enter the project’s agent API key.

7

Optional: Configure the Monitoring Agent to use a proxy server.

To configure the agent to connect to Ops Manager via a proxy server, you must specify the server in the httpProxy environment variable. In the /etc/mongodb-mms/monitoring-agent.config file, set the httpProxy value to the URL of to your proxy server:

httpProxy="http://proxy.example.com:9000"
8

Start the Monitoring Agent.

Issue the following command:

For Ubuntu 15.X or later:

sudo systemctl start mongodb-mms-monitoring-agent.service

For Ubuntu 14.04+:

sudo start mongodb-mms-monitoring-agent

Update the Monitoring Agent with a deb Package

Use this procedure to update the agent on Ubuntu with deb packages.

For Debian systems, instead use the Install or Update the Monitoring Agent from Archive procedure.

You can also access update instructions in Ops Manager, including commands you can copy and paste: click Deployment, then Agents, then Downloads & Settings.

1

Log in the the host where the Monitoring Agent is installed.

2

Stop any currently running Monitoring Agents.

Issue the following command:

pkill -f mongodb-mms-monitoring-agent
3

Login to Ops Manager.

4

Click Deployment, then Agents, and then Downloads & Settings.

5

Select Ubuntu<version> - DEB.

6

Download the latest version of the Monitoring Agent package.

On a system shell, issue a curl command to download the deb for the agent that works on your platform:

Note

Replace <OpsManagerHost:Port> with the hostname and port of your Ops Manager installation.

For Ubuntu 15.04+ or 16.04+ on x64 architecture:

curl -OL https://<OpsManagerHost:Port>/download/agent/monitoring/mongodb-mms-monitoring-agent_latest_amd64.ubuntu1604.deb

For Ubuntu 16.X on PowerPC architecture:

curl -OL https://<OpsManagerHost:Port>/download/agent/monitoring/mongodb-mms-monitoring-agent_latest_ppc64e1.ubuntu1604.deb

For Ubuntu 14.04+ on x64 architecture:

curl -OL https://<OpsManagerHost:Port>/download/agent/monitoring/mongodb-mms-monitoring-agent_latest_amd64.deb
7

Install the Monitoring Agent package.

To install the agent that works on your platform, issue the appropriate command to install the package:

For Ubuntu 15.04+ or 16.04+ on x64 architecture:

sudo dpkg -i mongodb-mms-monitoring-agent_latest_amd64.ubuntu1604.deb

For Ubuntu 16.X on PowerPC architecture:

sudo dpkg -i mongodb-mms-monitoring-agent_latest_ppc64e1.ubuntu1604.deb

For Ubuntu 14.04+ on x64 architecture:

sudo dpkg -i mongodb-mms-monitoring-agent_latest_amd64.deb
8

Start the Monitoring Agent.

Issue the following command:

sudo start mongodb-mms-monitoring-agent