• Recent
    • Tags
    • Popular
    • Register
    • Login

    Please Note This forum exists for community support for the Mango product family and the Radix IoT Platform. Although Radix IoT employees participate in this forum from time to time, there is no guarantee of a response to anything posted here, nor can Radix IoT, LLC guarantee the accuracy of any information expressed or conveyed. Specific project questions from customers with active support contracts are asked to send requests to support@radixiot.com.

    Radix IoT Website Mango 3 Documentation Website Mango 4 Documentation Website Mango 5 Documentation Website

    Mango as SNMP Trap Receiver

    How-To
    2
    4
    1.3k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • W
      Wingnut2.0
      last edited by

      Re: How-to test SNMP Trap in Mango

      I have been trying to configure Mango to receive Traps using the instructions in this post from 2009. I realize that many improvements have been made to the SNMP Data Source since then and I was looking to get confirmation that this is still the correct approach.

      I confirmed Mango(java) is listening on 162 as root and I have sent test traps but see nothing in the log.

      1 Reply Last reply Reply Quote 0
      • phildunlapP
        phildunlap
        last edited by

        Hi Wingnut2.0,

        I don't believe anything has changed with regards to traps, unless it was in the SNMP4J library. I didn't look too deeply into what logging is available in SNMP4J, but it looks like if you set

        x.sct.snmp.trapResponse=true

        in your env.properties at startup then any trap PDU that makes it to the data source should produce either an event or a log message. I would have expected you already to have gotten a "Trap not handled" warning from your data source had your test message gotten through.

        The incoming trap message must either have a source address that matches the target address of the data source, and then the local address must either be blank or must match the agent address. Here's the code for that socket's multicaster:

         public synchronized void processPdu(CommandResponderEvent evt) {
                    PDU command = evt.getPDU();
                    if (command != null) {
                        // Get the peer address
                        String peer = evt.getPeerAddress().toString();
                        int slash = peer.indexOf('/');
                        if (slash > 0)
                            peer = peer.substring(0, slash);
        
                        String localAddress = "";
                        if (command instanceof PDUv1)
                            localAddress = ((PDUv1) command).getAgentAddress().toString();
        
                        // Look for the peer in the data source list.
                        for (SnmpDataSourceRT ds : dataSources) {
                            if (ds.getAddress().equals(peer)) {
                                if (StringUtils.isBlank(ds.getLocalAddress()) || localAddress.equals(ds.getLocalAddress()))
                                    ds.receivedPDU(evt);
                            }
                        }
                    }
                }
        

        So, if you're testing traps with a command line tool or something, you may need to set the host for the data source to localhost or the IP of the machine you're sending the test traps from.

        1 Reply Last reply Reply Quote 0
        • W
          Wingnut2.0
          last edited by

          Thank you Phil.

          1 Reply Last reply Reply Quote 0
          • phildunlapP
            phildunlap
            last edited by

            Certainly, I hope it's useful!

            1 Reply Last reply Reply Quote 0
            • First post
              Last post