Question

I have inherited a MIB and example documentation, and need to re-implement the code that generates traps. (For various reason the original code is lost and gone forever, but CM is not my question.)

The MIB says:

    alertObjects     OBJECT IDENTIFIER ::= { corpAlert 1 }

    alertEvents      OBJECT IDENTIFIER ::= { corpAlert 2 }

    alertDispatchTime OBJECT-TYPE
        SYNTAX OCTET STRING
        MAX-ACCESS read-only
        STATUS current
        DESCRIPTION
            "Time Event Dispatched"
        ::= { alertObjects 3 }

    testFailure OBJECT IDENTIFIER ::= { alertEvents 4 }

    testFailureClearTrap NOTIFICATION-TYPE
    OBJECTS  
    { 
        alertDispatchTime,
        [omitted]
    }
    STATUS   current
    DESCRIPTION
         "Clear prior failure"
   ::= { testFailure 0 }

Our documentation has the following snippet:

/usr/bin/snmptrap \
   -v 1 \
   -c public 192.168.0.2:162 [our-base-oid] 127.0.0.1 6 4 '' \
   [our-base-oid].2.4.0.4.1.0 s "May 21 2007 10:19PM" \
   [etc]

What I can't figure out is the OID used for the alert dispatch time. I would understand it if it were [our-base-oid].1.3.0, or even [our-base-oid].2.4.0.[our-base-oid].1.3. If we were generating a trap at { alertEvents 3 }, what would the suffix be for the individual objects?

It is possible that the MIB was updated after the documentation, so if this looks wrong to an expert then what should the OID be for the alertDispatchTime?

Thanks.

Was it helpful?

Solution

As defined here, alertDispatchTime is a scalar object (only one instance), so its instance subidentifier is always 0 (full OID is [corpAlert].1.3.0). The notification's OID is [corpAlert].2.4.0.

Assuming by "[our-base-oid]" you mean corpAlert, the snmptrap command shown doesn't look to be correct because [our-base-oid].2.4.0.4.1.0 would be testFailureClearTrap.4.1.0, which doesn't make sense: traps don't have instance subidentifiers. But I'm making some assumptions here about the parts of the MIB spec you've not included.

OTHER TIPS

If you have a working system, maybe it'll good if you can generate a trap and see its contents.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top