配置snmptrap
vi /etc/snmp/snmptrap.conf,在文件最后添加如下
agentAddress udp:127.0.0.1:161
view systemonly included .1.3.6.1.2.1.1
view systemonly included .1.3.6.1.2.1.25.1
rocommunity csg-tsgz991 172.16.140.214 -V systemonly
rouser authOnlyUser
sysLocation Sitting on the Dock of the Bay
sysContact Me <me@example.org>
sysServices 72
proc mountd
proc ntalkd 4
proc sendmail 10 1
disk / 10000
disk /var 5%
includeAllDisks 10%
load 12 10 5
trap2sink 172.16.140.214 csg-tsgz991
iquerySecName internalUser
rouser internalUser
defaultMonitors yes
linkUpDownNotifications yes
extend test1 /bin/echo Hello, world!
extend-sh test2 echo Hello, world

本文档详细介绍了如何在Linux(CentOS)系统上配置SNMPtrap。首先,需要编辑/etc/snmp/snmptrap.conf文件,添加设备IP和团体名。例如,将172.16.149.214替换为实际设备IP,csg-tsgz991替换为实际团体名。最后,通过运行'systemctl restart snmpd && systemctl enable snmpd'命令来重启并启用SNMPd服务。

1万+

被折叠的 条评论
为什么被折叠?



