Le 18/11/2013 14:22, Joshua Lim replied :
>> 
>> Do you really need an SMI v1 description of the traps, or simply
>> the possibility to send SNMP v1 traps ? I suppose it is the second
>> proposition, then you may define the MIB in v2 (SMI v2), and though
>> send traps in v1 (SNMP v1).
> 
> Hi Olivier, thanks for replying.  Yes, you're right that I'm trying to send 
> SNMP v1 traps as I've not figured out how to send SNMP v2 traps using Delphi 
> Synapse - 
> http://stackoverflow.com/questions/19655128/how-to-send-snmp-v2-trap-using-ararat-synapse.
>   
> I tried to create an MIB for that purpose using Agent++ MIB designer create 
> MIB wizard.  But my user's NMS is unable to validate the MIB file as it has a 
> v2 import for enterprise.
> I'm now trying the following, not sure if it will work?
> TEST-MIB DEFINITIONS ::= BEGIN
> IMPORTS       enterprises             FROM SNMPv2-SMI TRAP-TYPE               
>         FROM RFC-1215   OBJECT-TYPE                             FROM RFC-1212;

Let's take an example.

Suppose you want to send an SNMPv1 trap with enterprise oid myTestOid
and specific number 113, and with object myTestFoobar in variable
bindings.

In an SMIv1 mib, you would have written something like that:
=====================================================================
myTestTrapFoobarFailed TRAP-TYPE
    ENTERPRISE  myTestOid
    VARIABLES   { myTestFoobar }
    DESCRIPTION
        "The myTestTrapFoobarFailed trap signifies that there is
         a failure in a Foobar system. The variable myTestFoobar
         specifies what occurs to the Foobar."
    ::= 113
=====================================================================

By SMIv1 is dead. In your SMIv2 mib, you will write instead:
=====================================================================
myTestTrapOid            OBJECT IDENTIFIER ::= { myTestOid 0 }

myTestTrapFoobarFailed NOTIFICATION-TYPE
    OBJECTS { myTestFoobar }
    STATUS  current
    DESCRIPTION
        "The myTestTrapFoobarFailed trap signifies that there is
         a failure in a Foobar system. The variable myTestFoobar
         specifies what occurs to the Foobar."
    ::= { myTestTrapOid 113 }
=====================================================================

It defines *exactly* the same trap, and you can quietly send an SNMPv1
trap with enterprise oid myTestOid and specific number 113.

Best regards,
-- 
Olivier Miakinen

------------------------------------------------------------------------------
Shape the Mobile Experience: Free Subscription
Software experts and developers: Be at the forefront of tech innovation.
Intel(R) Software Adrenaline delivers strategic insight and game-changing 
conversations that shape the rapidly evolving mobile landscape. Sign up now. 
http://pubads.g.doubleclick.net/gampad/clk?id=63431311&iu=/4140/ostg.clktrk
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to