Navigation

Install or Update the Monitoring Agent on Windows

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 Cloud 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 Cloud Manager, which processes and renders this data. The agent initiates all connections between the agent and Cloud Manager, and communications between the agent and Cloud 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.

Note

Beginning with Monitoring Agent version 5.0.0, Cloud Manager Premium uses 10-second granularity for monitoring metrics. See Monitoring Metrics Per Cloud Manager Plan.

This tutorial guides you through the steps necessary to install or update the Monitoring Agent on your system.

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 api-agents.mongodb.com on port 443 (HTTPS).

Cloud Manager does not make any outbound connections to the agents or to MongoDB instances. If Exposed DB Host Check is enabled, Cloud 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. Cloud Manager distributes monitoring assignments among up to 100 running agents. Each agent monitors a different set of MongoDB processes. One Monitoring Agent per group is the primary agent. The primary agent reports the cluster’s status to Cloud Manager. As agents are added or shut down, Cloud Manager redistributes assignments. If the primary agent fails, Cloud 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 Cloud 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.

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, Cloud 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 Cloud 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 on Windows

Use this procedure to install the agent on Windows.

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

1

Download and run the latest version of the Monitoring Agent installation binary.

To download the installation binary, use the following URL:

https://cloud.mongodb.com/download/agent/monitoring/mongodb-mms-monitoring-agent-latest.windows_x86_64.msi

During installation, the installer prompts you to specify the folder for storing configuration and log files. It is strongly advised that you encrypt or restrict access to this folder.

2

Generate an agent API key or retrieve an existing agent API key for your Cloud Manager group.

  1. Click + Generate Key.

Note

The button appears only if the current user is the group owner and the group either has no Agent API keys or just the Original Group API key. An Original Group API key exists only in groups created prior to the new Agent API Key model. The new model allows a group to have more than one key and permits any of the group’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, Cloud Manager displays it one time only. You must copy it and store it in a secure place. Cloud Manager will never display the full key again.

To monitor MongoDB deployments that use Kerberos authentication, do the following when pasting the Agent API key:

  1. Click Advanced Settings....
  2. Type the Active Directory username.
  3. Type the corresponding password.
  4. Type the NetBIOS name of the corresponding AD domain.
3

Edit the monitoring-agent.config file to include your agent API key, the hostname of the Monitoring server and, optionally, the URL for a proxy server.

In the C:\MMSData\Monitoring\monitoring-agent.config file, set these properties:

Property Value
mmsApiKey Agent API key
mmsGroupId Group ID
mmsBaseUrl Hostname of the Monitoring server
httpProxy (optional) The URL of to your proxy server
4

Start the Monitoring Agent.

Issue the following command:

In Windows Control Panel, open Administrative Tools, and then open Services.

In the list of services, select the Cloud Manager Monitoring Agent service. Select the Action menu and select Start.

Update the Monitoring Agent on Windows

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

To update the agent on Windows systems:

1

Stop any currently running Monitoring Agents.

In Windows Control Panel, open Administrative Tools and then Services.

In the list of services, select the Cloud Manager Monitoring Agent service. Select the Action menu and select Stop.

2

Download and run the latest version of the Monitoring Agent installation binary.

To download the installation binary, use the following URL:

https://cloud.mongodb.com/download/agent/monitoring/mongodb-mms-monitoring-agent-latest.windows_x86_64.msi

During installation, the installer prompts you to specify the folder for storing configuration and log files. It is strongly advised that you encrypt or restrict access to this folder.

3

Enter an existing agent API key or generate an agent API key for your Cloud Manager group.

You can use an Agent API key that you have already generated for the group. Otherwise, you can generate a new Agent API key. A group can have more than one Agent API key, and any of the group’s agents can use any of the keys. For more information, see Manage Agent API Keys.

To generate an Agent API key, go to the Agent API Keys tab. To navigate to the tab, from the Deployment view, click the Agents tab and then the Agent API Keys tab.

Important

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

4

Edit the monitoring-agent.config file to include your Group ID, the agent API key and, optionally, the URL for a proxy server.

In the C:\MMSData\Monitoring\monitoring-agent.config file, set these properties:

Property Value
mmsGroupId The Group ID
mmsApiKey The Agent API key
httpProxy (optional) The URL of to your proxy server
5

Start the Monitoring Agent.

In Windows Control Panel, open Administrative Tools, and then open Services.

In the list of services, select the Cloud Manager Monitoring Agent service. Select the Action menu and select Start.