mibble-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Mibble-users] parse TRAP-TYPE


From: Per Cederberg
Subject: Re: [Mibble-users] parse TRAP-TYPE
Date: Tue, 28 May 2013 13:24:56 +0200

Yes, the TRAP-TYPE is parsed and accessible in Mibble. But in SMIv1, the traps aren't assigned to OIDs, so they are a bit more tricky to find. Basically you search for them with their numeric value ("1", "2", etc):

   mib.getSymbolByValue("1")

Or you can find the traps by iterating over all MibValueSymbol instances, filtering out the symbols with a type that is instanceof SnmpTrapType.

You can always inspect the parsed results by using the MibblePrinter utility (which pretty-prints the parsed MIB). A small example for RFC1382-MIB:

#> bin/MibblePrinter.sh src/mibs/ietf/RFC1382-MIB

x25Restart TRAP-TYPE
    ENTERPRISE      x25
    VARIABLES       { x25OperIndex }
    DESCRIPTION
            "This trap means the X.25 PLE sent or
            received a restart packet.  The restart that
            brings up the link should not send a
            x25Restart trap so the interface should send
            a linkUp trap.  Sending this trap means the
            agent does not send a linkDown and linkUp
            trap."
    ::= 1

Cheers,

/Per


On Tue, May 28, 2013 at 8:19 AM, "Tim Schöndorfer" <address@hidden> wrote:
Hello,
 
I writing a snmp-trapreceiver with mibble. But mibble can not find the trap in the MIB-file (i think thats because the trap isnt a object-type, it is save in the mib as a TRAP-TYPE).
I spending much time on search for a solution, but i didnt find a way to parse the mib file and get the trap description or the trap name. The traps are snmp v1 traps so i get the enterprise oid and a specific number from the trap pdu and i try to parse the mib file with "Mib mib = MibLoader.load(Mib-File) and mib.getSymbolByOid(EnterpriseOid+.0.+specificNumber);" but this doenst work(it only works with normal OIDs). So how can i parse a mib-file with mibble to get the TRAP-TYPEs?
 
Thanks, Tim Schöndorfer

_______________________________________________
Mibble-users mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/mibble-users



reply via email to

[Prev in Thread] Current Thread [Next in Thread]