opennms snmpv3陷阱和通知

时间:2018-04-25 21:53:11

标签: opennms

我已通过docker镜像部署了OpenNMS,并且SNMPv3轮询正常工作,但无法获取SNMPv3陷阱或通知工作。

TRAPD-configuration.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中检索远程engineID。

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

关于我做错的任何想法?

1 个答案:

答案 0 :(得分:1)

请你试试以下内容:

打开$OPENNMS_HOME/etc/service-configuration.xml并在AsteriskGatway服务后启动Trapd守护程序。为此,请找到以下XML块:

<service enabled="true">
    <name>OpenNMS:Name=Trapd</name>
    <class-name>org.opennms.netmgt.trapd.jmx.Trapd</class-name>
    <invoke method="init" pass="0" at="start"/>
    <invoke method="start" pass="1" at="start"/>
    <invoke method="status" pass="0" at="status"/>
    <invoke method="stop" pass="0" at="stop"/>
</service>

默认情况下,Trapd在Correlator之后启动。剪切&amp;在AsteriskGateway服务之后粘贴整个服务定义块:

<service enabled="false">
    <name>OpenNMS:Name=AsteriskGateway</name>
    <class-name>org.opennms.netmgt.asterisk.agi.jmx.AsteriskGateway</class-name>
    <invoke method="init" pass="0" at="start"/>
    <invoke method="start" pass="1" at="start"/>
    <invoke method="status" pass="0" at="status"/>
    <invoke method="stop" pass="0" at="stop"/>
</service>

您现在可以尝试处理SNMPv3陷阱吗?