Re: Define Trap mib file and generate Trap codes problem

"Alexander King" <[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).
>>For use SMIv2 I just replace ACCESS for MAX-ACCESS,TRAP-TYPE for NOTIFICATION-TYPE,is it right?

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.

>>If I donot use the same parent OID,how do I distinguish the notification entries belong to?I meaning I use the same OID as some notification entries so we can easily known which alarm information they belong to.another way to solve this?because I have a lot of this entries.I will go to see the mibs arragment Howtos.

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

What was 'XXX' ?

>>the XXX is my corporation name(you known it,:=)),I defined the scalars,tables,and notification entries in one file,so I can run the mib2c -c mib2c.scalar.conf XXX,mib2c -c mib2c.iterate.conf XXX, mib2c -c mib2c.notify.conf XXX and integrated three code files into one,and compiling it into my subagent.is it right?

> 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.

>> XXX is stand for uit,I had my mib file in the last mail, it ismaybe give you some information.

> 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.

>>My start point have serval TRAP-TYPE,but they are belong to two difference parent OIDs,I just got one trap function.I donot know why.

> 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.

>>I will do this now.need learn how to arrangement the trap file structure.

Thank you,Dave!

Alex

------------------------------------------------------------------------------
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.