On this page本页内容
SNMP is only available in MongoDB Enterprise.SNMP仅在MongoDB企业版中可用。
MongoDB Enterprise on macOS does not include support for SNMP due to SERVER-29352.由于服务器为29352,macOS上的MongoDB Enterprise不支持SNMP。
MongoDB Enterprise can provide database metrics via SNMP, in support of centralized data collection and aggregation. MongoDB Enterprise可以通过SNMP提供数据库指标,以支持集中的数据集合和聚合。This document identifies common problems you may encounter when deploying MongoDB Enterprise with SNMP as well as possible solutions for these issues.本文档介绍了使用SNMP部署MongoDB Enterprise时可能遇到的常见问题,以及这些问题的可能解决方案。
See Monitor MongoDB With SNMP on Linux and Monitor MongoDB Windows with SNMP for complete installation instructions.有关完整的安装说明,请参阅Linux上使用SNMP监控MongoDB和使用SNMP监控MongoDB Windows。
If you receive the following error message when trying to monitor with SNMP:如果尝试使用SNMP进行监视时收到以下错误消息:
<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.mongod的SNMP访问。
By default, SNMP access to 默认情况下,会启用对mongod instances is enabled. mongod实例的SNMP访问。Starting in MongoDB 4.0.6, you can disable SNMP access using either command-line option 从MongoDB 4.0.6开始,可以使用命令行选项--snmp-disabled or the configuration file option snmp.disabled.--snmp-disabled或配置文件选项snmp.disabled来禁用SNMP访问。
The following in the mongod logfile:mongod日志文件中包含以下内容:
Warning: Failed to connect to the agentx master agent
AgentX is the SNMP agent extensibility protocol defined in Internet RFC 2741. AgentX是Internet RFC 2741中定义的SNMP代理扩展协议。It explains how to define additional data to monitor over SNMP. 它解释了如何定义通过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.当MongoDB无法连接到agentx主代理时,请使用以下过程确保SNMP子代理可以正确连接到SNMP主代理。
mongod has appropriate permissions to open a UNIX domain socket.mongod具有打开UNIX域套接字的适当权限。One of the following errors at the command line:命令行出现以下错误之一:
Error parsing command line: unknown option snmp-master try 'mongod --help' for more information
Error parsing command line: unknown option snmp-subagent try 'mongod --help' for more information
mongod binaries that are not part of the Enterprise Edition produce this error. 不属于企业版的二进制文件会产生此错误。Install the Enterprise Edition and attempt to start 安装企业版并尝试再次启动mongod again.mongod。
Other MongoDB binaries, including 如果尝试使用mongos will produce this error if you attempt to start them with snmp-master or snmp-subagent. snmp-master或snmp-subagent启动其他MongoDB二进制文件,包括mongos,将产生此错误。Only 只有mongod supports SNMP.mongod支持SNMP。
MongoDB Enterprise on macOS does not include support for SNMP due to SERVER-29352.由于SERVER-29352,macOS上的MongoDB Enterprise不支持SNMP。
SNMPAgentThe following line in the log file indicates that 日志文件中的以下行表示mongod cannot read the mongod.conf file:mongod无法读取mongod.conf文件:
[SNMPAgent] warning: error starting SNMPAgent as master err:1
If running on Linux, ensure 如果在Linux上运行,请确保mongod.conf exists in the /etc/snmp directory, and ensure that the mongod UNIX user has permission to read the mongod.conf file./etc/snmp目录中存在mongod.conf,并确保mongod UNIX用户具有读取mongod.conf文件的权限。
If running on Windows, ensure 如果在Windows上运行,请确保mongod.conf exists in C:\snmp\etc\config.C:\snmp\etc\config中存在mongod.conf。