The configuration filename is tool-dependent. For example, when using net-snmp the configuration file is snmpd.conf . 

By default SNMP uses UNIX domain for communication between the agent (i.e. snmpd or the master) and sub-agent (i.e. MongoDB). 

Ensure that the agentXAddress specified in the SNMP configuration file for MongoDB matches the agentXAddress in the SNMP master configuration file. 

Step 2: Start MongoDB. Start mongod with the snmp-subagent to send data to the SNMP master. 

mongod --snmp-subagent 

Step 3: Confirm SNMP data retrieval. Use snmpwalk to collect data from mongod : 

Connect an SNMP client to verify the ability to collect SNMP data from MongoDB. 

Install the net-snmp 89 package to access the snmpwalk client. net-snmp provides the snmpwalk SNMP client. 

snmpwalk -m /usr/share/snmp/mibs/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 for client communi- cation. 

## Optional: Run MongoDB as SNMP Master 

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

cp mongod.conf.master /etc/snmp/mongod.conf 

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

mongod --snmp-master 

## Monitor MongoDB Windows with SNMP 

New in version 2.6. 

## Enterprise Feature 

SNMP is only available in MongoDB Enterprise$^{90}$. 

## Overview 

MongoDB Enterprise can provide database metrics via SNMP, in support of centralized data collection and aggrega- tion. This procedure explains the setup and configuration of a mongod.exe instance as an SNMP subagent, as well as initializing and testing of SNMP support with MongoDB Enterprise. 

## See also: 

Monitor MongoDB With SNMP on Linux (page 239) and Troubleshoot SNMP (page 242) for more information. 

