2010/1/12 Alexander King <new...@foxmail.com>:
> and more,i decide to test the v1 and v2 trap prototype,but I got two mib
> files use the same template(defined by myself too),UIT-TRAP-MIB.mib and
> UIT-NOTIFICATION-MIB.mib

OK - first thing.  Forget about UIT-TRAP-MIB.
It's a bogus mixture of SMIv1 and SMIv2.
The Net-SNMP parser might make something of it,
because we bend over backwards to try and be helpful,
but anything with an ounce of self-respect will reject it
out of hand.

SMIv1 is obsolete.     SMIv2 can be used with any
version of SNMP (including SNMPv1) anyway.
Delete UIT-TRAP-MIB.   It's not worth bothering with.



Second thing:
Management objects and notifications are different things,
and should be kept separate in the MIB.   Have one tree
containing your scalars and tables, and a second tree
containing your notifications.
  It's technically possible to mix notifications with scalar
objects, but it's not a good idea.   It is *not* valid to have
notifications as children of a table.

Keep them separate - it's a lot simpler.
Your 'trapTesting' definition is the right way to go.


Third thing:
Define the notifications using OIDs of the form

    systemNumbertrap NOTIFICATION-TYPE
        OBJECTS  { systemNumber }
        STATUS     current
        DESCRIPTION "This is just a demo"
        ::= { trapTesting  0  51898 }

i.e. with an intermediate '0' subidentifier.
This will help when working with SNMPv1 traps.
(In particular, when converting traps between
SNMPv1 and SNMPv2, and back again).



Fourth thing:
You forgot the semicolon at the end of the IMPORTS clause.


With this added, and using trapTesting as the root of the
notifications, then I get the full set of send_xxx routines
from mib2c.notify.conf.



Dave

------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
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