我已经通过 docker 映像部署了 OpenNMS,并且 SNMPv3 轮询工作,但无法让 SNMPv3 陷阱或通知工作。
陷阱配置.xml:
<?xml version="1.0"?>
<trapd-configuration snmp-trap-port="162" new-suspect-on-trap="true">
<snmpv3-user
security-name="trapuser"
security-level="3"
auth-passphrase="authsecret"
auth-protocol="SHA"
privacy-passphrase="privsecret"
privacy-protocol="AES"/>
</trapd-configuration>
如果我从另一台主机运行以下命令,OpenNMS 通过 SNMPv3 轮询该主机:
snmptrap -Dusm -v 3 -l authPriv -u trapuser -a SHA -A authsecret -x AES -X privsecret <opennms-host-ip> 42 coldStart.0
OpenNMS 不生成任何事件。在 trapd.log 我可以看到以下警告:
2018-04-26 09:26:33,364 WARN [DefaultUDPTransportMapping_0.0.0.0/162] o.s.MessageDispatcherImpl: statusInfo=1.3.6.1.6.3.15.1.1.3.0 = 0, status=1404
据我所知,这与一个未知的用户名有关。
同样,通知也不起作用,我在 trapd.log 文件中收到相同的警告,在发件人端也收到类似的警告。如果我运行 tcpdump,我可以看到它从 opennms 检索远程引擎 ID。
snmpinform -Dusm -v 3 -l authPriv -u trapuser -a SHA -A authsecret -x AES -X privsecret <opennms-host-ip> 42 coldStart.0
registered debug token usm, 1
usm: potentially bootstrapping the USM table from session data
usm: getting user
usm: USM processing has begun (offset 39)
usm: getting user
usm: Failed to find engine data.
usm: USM processing completed.
usm: USM processing begun...
usm: USM processing completed.
usm: potentially bootstrapping the USM table from session data
usm: no flag defined... continuing
usm: user exists? x=(nil)
usm: Building user trapuser...
usm: USM processing has begun (offset 80)
usm: getting user trapuser
usm: match on user trapuser
usm: Encryption successful.
usm: USM processing completed.
usm: USM processing begun...
usm: match on user trapuser
usm: USM processing completed.
snmpinform: Unknown user name
关于我做错了什么的任何想法?