SNMPD 启动时没有出现错误,但是没有监听任何端口?

SNMPD 启动时没有出现错误,但是没有监听任何端口?

HP ProLiant DL360 G7 运行 CentOS6 5.7 和 Net-SNMP 5.3.2.2-14。

我在远程站点有 7 台这样的服务器,它们都运行 CentOS 5.7 和 RHEL 5.7 的混合版本,并且从 RPM 安装了相同的 Net-SNMP。在一台服务器上,我的 NMS 不断报告无法连接到 SNMP 服务。我忽略了它,因为它通常会在约 15 分钟内清除,但今天从早上开始,每小时发生 2-3 次。

我已修改 snmpd 启动脚本以记录到文件(默认为 /dev/null)。启动时日志文件中没有错误:

could not open /proc/net/if_inet6
cannot open /proc/net/snmp6 ...
cmaX: listening for subagents on port 25375
cmaX: sent ColdStarts on ports 25376 to 25393
cmaX: subMIB 1 handler has disconnected
NET-SNMP version 5.3.2.2
cmaX: subMIB 2 handler has disconnected
Connection from UDP: [127.0.0.1]:50654
cmaX: subMIB 3 handler has disconnected
Received SNMP packet(s) from UDP: [127.0.0.1]:50654
cmaX: subMIB 5 handler has disconnected

我推测 if_inet6 适用于我们不使用的 IPv6。snmpd.conf 如下:

# Following entries were added by HP Insight Management Agents at
#      Tue May 15 10:58:17 CLT 2012
dlmod cmaX /usr/lib64/libcmaX64.so
rwcommunity public 127.0.0.1
rocommunity public 127.0.0.1
rwcommunity 3adRabRu 172.16.37.37
rocommunity 3adRabRu 172.16.37.37
trapcommunity traps
trapsink 172.16.37.37 traps
syscontact Lukasz
syslocation Santiago, Chile
# ---------------------- END --------------------
com2sec rwlocal default public
com2sec rolocal default public
com2sec subnet  default 3adRabRu
group   rwv2c   v2c             rwlocal
group   rov2c   v2c             rolocal
group   rov2c   v2c             subnet
view    all     included        .1
access  rwv2c   ""      any             noauth          exact   all     all     none
access  rov2c   ""      any             noauth          exact   all     none    none

有什么建议吗?IP 表已关闭。

答案1

查看snmpd.conf(5)

  agentaddress [<transport-specifier>:]<transport-address>[,...]
          defines  a  list  of listening addresses, on which to receive incoming 
          SNMP requests.  See the section LISTENING ADDRESSES in the
          snmpd(8) manual page for more information about the format of listening address

因此,请尝试在顶部添加类似这样的内容snmpd.conf

#  Listen for connections on all interfaces (both IPv4 *and* IPv6)

agentAddress udp:161,udp6:[::1]:161

相关内容