Re: Define Trap mib file and generate Trap codes problem

Dave Shield <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
2010/1/11 Alexander King <[email protected]>:
> I define the trap entries in the same mib file like this:
>
> controllerInfo     OBJECT IDENTIFIER ::= { systeminfoController 1  }
>     systemNumber OBJECT-TYPE
>         SYNTAX DisplayString( SIZE( 0..256 ) )
>         ACCESS read-only
....

> and then:
>
>     systemNumbertrap TRAP-TYPE

> is it right?

You seem to be using SMIv1 for your MIBs.
That has been obsolete for several years.

Please use SMIv2  (MAX-ACCESS rather than ACCESS,
and NOTIFICATION-TYPE rather than TRAP-TYPE).

And you wouldn't normally use the same OID as the
parent of a management information object, and a
notification.   Traps are usually defined within a separate
subtree.
   See (e.g.) the Net-SNMP MIBs for a typical arrangement.



> I used ' mib2c -c mib2c.notify.conf XXX ' generate the trap code,

What was 'XXX' ?

> but I just got send_controllerInfotrap_oid one trap send function

I'm guessing that's probably the only trap within the subtree you specified.
But since you didn't tell us what XXX was, that's only a guess.



> and do I should be have two send_XXX_oid functions?

If your starting point contained two traps, then yes - you should
have two send_xxx_trap functions.


> would you some warmhearted body mail me a trap prototype(mib and modified .c
> files) or some hints and links?

Define the MIB using SMIv2.
Keep all of the trap definitions in the same subtree.


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
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.