Troubleshoot SNMP

New in version 2.6.

Enterprise Feature

SNMP is only available in MongoDB Enterprise.

MongoDB Enterprise on macOS does not include support for SNMP dueto SERVER-29352.

Overview

MongoDB Enterprise can provide database metrics via SNMP, insupport of centralized data collection and aggregation. This documentidentifies common problems you may encounter when deploying MongoDBEnterprise with SNMP as well as possible solutions for these issues.

See Monitor MongoDB With SNMP on Linuxand Monitor MongoDB Windows with SNMP forcomplete installation instructions.

Issues

Failed Global Initialization

If you receive the following error message when trying to monitor withSNMP:

  1. <Timestamp> F CONTROL [main] Failed global initialization: Bad Value: snmp.subagent is not allowed when snmp.disabled is specified

Ensure that you have not disabled SNMP access to mongod.

By default, SNMP access to mongod instances is enabled.Starting in MongoDB 4.0.6, you can disable SNMP access using eithercommand-line option —snmp-disabledor the configuration file option snmp.disabled.

Failed to Connect

The following in the mongod logfile:

  1. Warning: Failed to connect to the agentx master agent

AgentX is the SNMP agent extensibility protocol defined in InternetRFC 2741. It explains howto define additional data to monitor over SNMP. When MongoDB failsto connect to the agentx master agent, use the following procedure toensure that the SNMP subagent can connect properly to the SNMP master.

  • Make sure the master agent is running.
  • Compare the SNMP master’s configuration file with the subagentconfiguration file. Ensure that the agentx socket definition isthe same between the two.
  • Check the SNMP configuration files to see if they specify using UNIXDomain Sockets. If so, confirm that the mongod hasappropriate permissions to open a UNIX domain socket.

Error Parsing Command Line

One of the following errors at the command line:

  1. Error parsing command line: unknown option snmp-master
  2. try 'mongod --help' for more information
  1. Error parsing command line: unknown option snmp-subagent
  2. try 'mongod --help' for more information

mongod binaries that are not part of the EnterpriseEdition produce this error. Install the Enterprise Edition and attempt to startmongod again.

Other MongoDB binaries, including mongos will produce thiserror if you attempt to start them with snmp-master orsnmp-subagent. Only mongod supports SNMP.

MongoDB Enterprise on macOS does not include support for SNMP dueto SERVER-29352.

Error Starting SNMPAgent

The following line in the log file indicatesthat mongod cannot read the mongod.conf file:

  1. [SNMPAgent] warning: error starting SNMPAgent as master err:1

If running on Linux, ensure mongod.conf exists in the /etc/snmpdirectory, and ensure that the mongod UNIX user haspermission to read the mongod.conf file.

If running on Windows, ensure mongod.conf exists inC:\snmp\etc\config.