How to configure SNMP Northbound sends all alerts to an external monitoring host

Hello, OpenNMS community,

@jesse had instruction on how to set snmp northbound up with a short test command to demonstrate that it works. it worked on my new opennms setup.

Can you please show me what to modify on the bellow XML tag from @jesse so I can configure snmp northbound to send all arlams automatically once it detected/received?

Sorry, I’m new on OpenNMS so please excuse if I ask you nonsense
questions

As far I can see, the rule evaluated with SpEL to a boolean. You should be able to use something like .* to match against any UEI.

Thank you @indigo for your reply. I have check out the SpEL, and try to understand the concept. I hope I will have it resolved soon.

Regards,
Arron

Hi @indigo,

This is my NBI file, I still don’t see any traps send out, would you mind point me out any error I have in this file?

Thank you,
Arron

true
1000
100
300000

<snmp-trap-sink>
    <name>SendTrapExternal</name>
    <ip-address>10.227.87.107</ip-address>
    <port>162</port> <!-- defaults to 162 if it is not specified -->
    <version>v2c</version> <!-- v1 or v2c -->
    <community>public</community>
    <mapping-group name="SendAllTraps">
        <rule>uei matches '.*'</rule> <!-- SPEL Expression against org.opennms.netmgt.alarmd.api.NorthboundAlarm -->
        <mapping name="trap01">
            <rule>uei == 'uei.opennms.org/alarms/trigger'</rule> <!-- SPEL Expression against org.opennms.netmgt.alarmd.api.NorthboundAlarm -->
            <enterprise-oid>.1.2.3.4.5.6.7.8.101</enterprise-oid>
            <specific>6</specific>
            <specific>1</specific>
            <varbind>
                <oid>.1.2.3.4.5.6.7.8.1</oid>
                <type>OctetString</type> <!-- OctetString, Int32, ObjectIdentifier, IpAddress, TimeTicks, Counter32, Gauge32, Opaque, Counter64 -->
                <value>eventParametersCollection[0].value.content</value> <!-- SPEL Expression against org.opennms.netmgt.alarmd.api.NorthboundAlarm -->
            </varbind>
            <varbind>
                <oid>.1.2.3.4.5.6.7.8.2</oid>
                <type>OctetString</type>
                <value>parameters['alarmMessage']</value>
                <max>48</max> <!-- If specified, and the type is OctetString, the value will be truncated if it has more than 'max' characters -->
            </varbind>
        </mapping>

        <mapping name="trap02">
            <rule>uei == 'uei.opennms.org/trap/myTrap2'</rule>
            <enterprise-oid>.1.2.3.4.5.6.7.8.101</enterprise-oid>
            <varbind>
                <oid>.1.2.3.4.5.6.7.8.2</oid>
                <type>OctetString</type>
                <value>parameters['myMessage']</value>
                <instance>parameters['.*']</instance> <!-- SPEL Expression against org.opennms.netmgt.alarmd.api.NorthboundAlarm -->
            </varbind>
        </mapping>
</mapping-group>
</snmp-trap-sink>

Did you try to use a
<max>48</max>
element (of course with another number than 48) for the varbind .1.2.3.4.5.6.7.8.2? Sometimes I didn’t get any traps when the max element was missing…