1

I've deployed OpenNMS through the docker images and have SNMPv3 polling working but haven't been able to get SNMPv3 traps or informs working.

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>

If I run the following from another host, which is being polled by OpenNMS via SNMPv3:

snmptrap -Dusm -v 3 -l authPriv -u trapuser -a SHA -A authsecret -x AES -X privsecret <opennms-host-ip> 42 coldStart.0

OpenNMS doesn't generate any event. In the trapd.log I can see the following warning:

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

From what I can tell this relates to an unknown username.

Likewise informs aren't working either and I get the same warning in the trapd.log file and a similar one at the sender side. If I run tcpdump I can see it retrieve the remote engineID from opennms.

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

Any ideas on what I'm doing wrong?

  • I tried to reproduce your test with Horizon 21.1.0. I ran in a problem which I've documented in our bug tracker here: https://issues.opennms.org/browse/NMS-10009. Can you please try to set OpenNMS Trapd into debug to see if you get the same error message? To set Trapd logging to DEBUG open ${OPENNMS_HOME}/etc/log4j2.xml and search for the line `""` and change from WARN to DEBUG. It takes a minute to reload the config, there is no restart necessary. – indigo Apr 27 '18 at 10:50
  • Thanks for your response. After changing the logging level to debug I get exactly the same messages in the trapd.log file. Also forgot to include that I'm running Horizon 21.0.5 – Luke Strong Apr 29 '18 at 23:00
  • We where able to fix this issue in version Horizon 22.0.0 and Meridian 2018.1.0 see here https://issues.opennms.org/browse/NMS-10009 – indigo May 17 '18 at 07:33

1 Answers1

1

Can you please try the following:

open the $OPENNMS_HOME/etc/service-configuration.xml and start the Trapd daemon after the AsteriskGatway service. To do this locate the following XML block:

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

By default Trapd is started after the Correlator. Cut & Paste the whole service definition block after the AsteriskGateway service:

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

Can you try to get SNMPv3 Traps processed now?

indigo
  • 338
  • 1
  • 9