Troubleshoot SNMP

在本页面

2.6 版的新功能。

Enterprise Feature

SNMP 仅在 MongoDB Enterprise 中可用。

由于SERVER-29352,因此 macOS 上的 MongoDB Enterprise 支持 SNMP。

Overview

MongoDB Enterprise 可以通过 SNMP 提供数据库 Metrics,以支持集中式数据收集和聚合。本文档确定了使用 SNMP 部署 MongoDB Enterprise 时可能遇到的常见问题,以及针对这些问题的可能解决方案。

有关完整的安装说明,请参见在 Linux 上使用 SNMP 监视 MongoDB使用 SNMP 监视 MongoDB Windows

Issues

无法连接

mongod日志文件中的以下内容:

Warning: Failed to connect to the agentx master agent

AgentX 是 Internet RFC 2741中定义的 SNMP 代理扩展协议。它说明了如何定义其他数据以通过 SNMP 进行监视。当 MongoDB 无法连接到 agentx 主代理时,请使用以下过程来确保 SNMP 子代理可以正确连接到 SNMP 主代理。

错误解析命令行

命令行中出现以下错误之一:

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不属于企业版的二进制文件会产生此错误。 安装企业版并尝试再次启动mongod

如果尝试使用snmp-mastersnmp-subagent来启动其他 MongoDB 二进制文件(包括mongos),则会产生此错误。仅mongod支持 SNMP。

由于SERVER-29352,因此 macOS 上的 MongoDB Enterprise 支持 SNMP。

启动 SNMPAgent 时出错

日志文件中的以下行指示mongod无法读取mongod.conf文件:

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

如果在 Linux 上运行,请确保/etc/snmp目录中存在mongod.conf,并确保mongod UNIX 用户具有读取mongod.conf文件的权限。

如果在 Windows 上运行,请确保C:\snmp\etc\config中存在mongod.conf

首页