snmpwalk -m C:\snmp\etc\config\MONGOD-MIB.txt -v 2c -c mongodb 127.0.0.1:<port> 1.3.6.1.4.1.34601 

<port> refers to the port defined by the SNMP master, not the primary port used by mongod.exe for client communication. 

## Optional: Run MongoDB as SNMP Master 

You can run mongod.exe with the snmp-master option for testing purposes. To do this, use the SNMP master configuration file instead of the subagent configuration file. From the directory containing the unpacked MongoDB installation files: 

copy mongod.conf.master C:\snmp\etc\config\mongod.conf 

Additionally, start mongod.exe with the snmp-master option, as in the following: 

mongod.exe --snmp-master 

## Troubleshoot SNMP 

New in version 2.6. 

## Enterprise Feature 

SNMP is only available in MongoDB Enterprise. 

## Overview 

MongoDB Enterprise can provide database metrics via SNMP, in support of centralized data collection and aggre- gation. This document identifies common problems you may encounter when deploying MongoDB Enterprise with SNMP as well as possible solutions for these issues. 

See Monitor MongoDB With SNMP on Linux (page 239) and Monitor MongoDB Windows with SNMP (page 240) for complete installation instructions. 

## Issues 

Failed to Connect The following in the mongod logfile: 

Warning: Failed to connect to the agentx master agent 

AgentX is the SNMP agent extensibility protocol defined in Internet RFC 2741$^{92}$. It explains how to define additional data to monitor over SNMP. When MongoDB fails to connect to the agentx master agent, use the following procedure to ensure that the SNMP subagent can connect properly to the SNMP master. 

1. Make sure the master agent is running. 

2. Compare the SNMP master’s configuration file with the subagent configuration file. Ensure that the agentx socket definition is the same between the two. 

3. Check the SNMP configuration files to see if they specify using UNIX Domain Sockets. If so, confirm that the mongod has appropriate permissions to open a UNIX domain socket. 

