笔记snmp-trap

40次阅读

共计 2293 个字符,预计需要花费 6 分钟才能阅读完成。

note : https://support.huawei.com/en…

接下来想办法让 olt 发点 trap 出来

雾草

0

Do you get an error when running

snmptrapd -f -Lo

or

 snmptrapd -f -Le
 

Your error is probably something like this

Warning: no access control information configured.
    (Config search path: /usr/local/etc/snmp:/usr/local/share/snmp:/usr/local/lib/snmp:/root/.snmp) This receiver will *NOT* accept any incoming notifications.

It might be that the conf file you edited is not on that path. In that case copy your conf file(/etc/snmp/snmptrap.conf) to a path from the error message.

It worked for me a few minutes ago.

mkdir .snmp 
cp whatyoursnmpconf ./.snmp/

put text into

disableAuthorization yes

这样 snmptrapd 就不作妖了。

这个视频靠谱

配置 trap 怎么都不对。!还好这个靠谱。

https://www.youtube.com/watch…

Dump commands:

snmp-agent target-host trap-paramsname reconms v1 securityname private
snmp-agent target-host trap-hostname huawei address 192.168.0.188 trap-paramsname reconms

如下修改,就不必每次改 ip 地址了

配置 OLT IP 地址

MA5608T> enable
MA5608T# config
MA5608T(config)# interface meth0
MA5608T(config)# ip address 192.168.0.98 255.255.255.0

Reconnect to the OLT on the new IP address 192.168.0.98
Add the default gateway and save configuration:

修改本机地址

ifconfig 192.168.0.188 netmask  255.255.255.0

配置 snmp agent 代理的参数

#snmp-agent target-host trap address 10.71.53.108 securityname
private v1
#display snmp-agent target-host

指令

snmp-agent target-host trap address udp-domain 192.168.1.1 params securityname huawei v2c

查看版本

display snmp-agent sys-info version

激活 trap

snmp-agent trap enable 

Choose one of the following commands as needed to configure a destination IP address of the traps and error codes sent from the device

snmp-agent heartbeat enable
snmp-agent heartbeat interval 3

发往地址

 snmp-agent target-host trap address udp-domain 10.11.1.98 udp-port 162 params securityname private v1 

格式:

snmp-agent target-host trap-paramsname paramsname {{ v1 | v2c} securityname securityname | v3 securityname securityname {authentication | noauthnopriv | privacy} } [binding-private-value] [private-netmanager]

undo snmp-agent target-host trap-paramsname paramsname

查看发往地址

 display snmp-agent target-host
 

显示 log

Configuring snmptrapd to accept SNMPv1 or SNMPv2c notifications
To receive SNMPv1 or SNMPv2c notifications you need to tell snmptrapd your community strings. The easiest way to do this is by using the

authCommunity snmptrapd.conf 

configuration file token. For example, this line:

authCommunity log,execute,net public

Since you’re apparently using Net-SNMP, the logfile is written where ever you said in snmpd.conf.This is usually by default

/var/log/snmpd.log


ref:基本概念

https://www.pcwdld.com/what-i…

正文完
 0