我使用的是 Ubuntu 10.04.4 LTS,无法升级到更高版本。
我已经使用命令安装了 snmpd 代理(NET-SNMP 版本 5.4.2.1)apt-get install snmpd
。
当发生发送陷阱的事件时,每个此类事件都会发送两个陷阱,而不是一个。
例如,当我使用命令关闭代理时/etc/init.d/snmpd stop
,会向目标主机发送两个关闭陷阱。如果我随后使用命令重新启动代理/etc/init.d/snmpd start
,则会向目标主机发送两个冷启动陷阱。
这是一个已知问题吗?是否有解决方案,或者是否需要更改配置以防止发送重复陷阱?
这些是该文件的内容/etc/snmp/snmpd.conf
:
rocommunity public
authtrapenable 1
trap2sink <trap destination hostname> public
这些是该文件的内容/etc/default/snmpd
:
# This file controls the activity of snmpd and snmptrapd
# MIB directories. /usr/share/snmp/mibs is the default, but
# including it here avoids some strange problems.
export MIBDIRS=/usr/share/snmp/mibs
# snmpd control (yes means start daemon).
SNMPDRUN=yes
# snmpd options (use syslog, close stdin/out/err).
SNMPDOPTS='-Ls3d -Lf /dev/null -u snmp -p /var/run/snmpd.pid -c /etc/snmp/snmpd.conf'
# snmptrapd control (yes means start daemon). As of net-snmp version
# 5.0, master agentx support must be enabled in snmpd before snmptrapd
# can be run. See snmpd.conf(5) for how to do this.
TRAPDRUN=no
# snmptrapd options (use syslog).
TRAPDOPTS='-Lsd -p /var/run/snmptrapd.pid'
# create symlink on Debian legacy location to official RFC path
SNMPDCOMPAT=yes