筆記:snmp trap

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

接下來想辦法讓olt發點trap出來

霧草

0dom

Do you get an error when runningthis

snmptrapd -f -Lo

or代理

snmptrapd -f -Le

Your error is probably something like thiscode

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.orm

It worked for me a few minutes ago.視頻

mkdir .snmp 
cp whatyoursnmpconf ./.snmp/

put text intotoken

disableAuthorization yes

這樣snmptrapd就不做妖了。ip

這個視頻靠譜

配置trap怎麼都不對。!還好這個靠譜。get

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...

相關文章
相關標籤/搜索