Hi Dave and ALL:
   
  
 2010/1/11 Alexander King <new...@foxmail.com>:
>>>If I do not use the same parent OID,how do I distinguish the
>>> notification entries belong to?

What do you mean by this?

If there is management information associated with a notification,
this would typically be listed in the OBJECTS clause of the notification
definition.   For example, see the linkUp/linkDown traps, in IF-MIB.

This also means that you've got information about *which* interface
(or more generally, which row of the table) triggered the trap.
  
 >>>In my testing mib, I have several scalars they belong to the same parent 
 >>>OID,and a table.
 so there are two kinds of the traps,one type belong to the parent OID which 
have some simple scalars children;and one type trap belong to the table. I 
donot know whether I make you see clearly in this point.
 

If the OID hostInterfaceFCEntry lies within the subtree rooted at
'uit', then mib2c should have generated a corresponding function
call.   If it lies outside this subtree, then it wouldn't.
  
 >>>>the second kind traps's father OID is hostInterfaceFCEntry,such like this:
     fcPorttrap TRAP-TYPE
        ENTERPRISE  hostInterfaceFCEntry
        VARIABLES { fcPort } 
        STATUS     current
        DESCRIPTION "Warning:fc port %d was failed!"
        ::=  10
  
 but I didnot got the send_hostInterfaceEntry_trap function.
  
 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,in file1 I got error like this: 
  
     fcConnections OBJECT-TYPE
        SYNTAX INTEGER
        ACCESS read-only
        STATUS current
        DESCRIPTION
             "fc Connections."
        ::= { hostInterfaceFCEntry 6 } 
------------------------------------------------------------------------------- 
       
--Trap prototype testing here.
-------------------------------------------------------------------------------
trapTesting     OBJECT IDENTIFIER ::= { systeminfoController 3  }
    systemNumbertrap TRAP-TYPE
     ENTERPRISE  controllerInfo
        VARIABLES  { systemNumber }
        STATUS current           --MG-soft report here has a ' 
G:\net-snmp\snmp\Trap-Test-                                        
--prototype\SNMPv1\UIT-TRAP-MIB.mib(243) : Error 6 : Invalid number'
        DESCRIPTION "This is just a demo"
        ::= 12 
 systemSerialNumbertrap TRAP-TYPE
     ENTERPRISE  controllerInfo
        VARIABLES { systemSerialNumber } 
        STATUS     current
        DESCRIPTION "This is just a demo"
        ::= 13
 systemTypetrap TRAP-TYPE
     ENTERPRISE  controllerInfo
        VARIABLES { systemType }
        STATUS     current
        DESCRIPTION "This is just a demo"
        ::= 14

 and in file2 I got many errors like this:
  
  
  G:\net-snmp\snmp\Trap-Test-prototype\SNMPv2\UIT-NOTIFICATION-MIB.mib(296) : 
Error 20 : Expected ", or FROM" but found "{"
 Error count exceeded maximum allowed number.
 Stopping compilation.
 G:\net-snmp\snmp\Trap-Test-prototype\SNMPv2\UIT-NOTIFICATION-MIB.mib(296) : 
Error 20 : Expected ", or FROM" but found "fcConnections"
 Error count exceeded maximum allowed number.
 Stopping compilation.
 G:\net-snmp\snmp\Trap-Test-prototype\SNMPv2\UIT-NOTIFICATION-MIB.mib(296) : 
Error 20 : Expected ", or FROM" but found "}"
 Error count exceeded maximum allowed number.
 Stopping compilation.
 G:\net-snmp\snmp\Trap-Test-prototype\SNMPv2\UIT-NOTIFICATION-MIB.mib(297) : 
Error 20 : Expected ", or FROM" but found "STATUS"
 Error count exceeded maximum allowed number.
 Stopping compilation.
 G:\net-snmp\snmp\Trap-Test-prototype\SNMPv2\UIT-NOTIFICATION-MIB.mib(297) : 
Error 20 : Expected ", or FROM" but found "current"
 Error count exceeded maximum allowed number.
 Stopping compilation.
 G:\net-snmp\snmp\Trap-Test-prototype\SNMPv2\UIT-NOTIFICATION-MIB.mib(298) : 
Error 20 : Expected ", or FROM" but found "DESCRIPTION"
 Error count exceeded maximum allowed number.
 Stopping compilation.
 G:\net-snmp\snmp\Trap-Test-prototype\SNMPv2\UIT-NOTIFICATION-MIB.mib(298) : 
Error 20 : Expected ", or FROM" but found "This is just a demo"
 Error count exceeded maximum allowed number.
 Stopping compilation.
 G:\net-snmp\snmp\Trap-Test-prototype\SNMPv2\UIT-NOTIFICATION-MIB.mib(299) : 
Error 20 : Expected ", or FROM" but found "::="
 Error count exceeded maximum allowed number.
 Stopping compilation.
 G:\net-snmp\snmp\Trap-Test-prototype\SNMPv2\UIT-NOTIFICATION-MIB.mib(299) : 
Error 20 : Expected ", or FROM" but found "{"
 Error count exceeded maximum allowed number.
 Stopping compilation.
 G:\net-snmp\snmp\Trap-Test-prototype\SNMPv2\UIT-NOTIFICATION-MIB.mib(299) : 
Error 20 : Expected ", or FROM" but found "hostInterfaceFCEntry"
 Error count exceeded maximum allowed number.
 Stopping compilation.
 G:\net-snmp\snmp\Trap-Test-prototype\SNMPv2\UIT-NOTIFICATION-MIB.mib(299) : 
Error 20 : Expected ", or FROM" but found "51908"
 Error count exceeded maximum allowed number.
 Stopping compilation.
 G:\net-snmp\snmp\Trap-Test-prototype\SNMPv2\UIT-NOTIFICATION-MIB.mib(299) : 
Error 20 : Expected ", or FROM" but found "}"
 Error count exceeded maximum allowed number.
 Stopping compilation.
 G:\net-snmp\snmp\Trap-Test-prototype\SNMPv2\UIT-NOTIFICATION-MIB.mib(300) : 
Error 20 : Expected ", or FROM" but found "END"
 Error count exceeded maximum allowed number.
 Stopping compilation.
 G:\net-snmp\snmp\Trap-Test-prototype\SNMPv2\UIT-NOTIFICATION-MIB.mib(300) : 
Error 20 : Expected ", or FROM" but found ""
  
 it look like something wrong in my NOTIFICATION-TYPE defination part:
  
     systemNumbertrap NOTIFICATION-TYPE
        OBJECTS  { systemNumber } 
        STATUS     current
        DESCRIPTION "This is just a demo"
        ::= { hostInterfaceFCEntry  51898 }
  
 The two attachments are my mib files for your test.Thank you all.Oh,my 
God,forgive me for my horrible foolishness.
  
 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
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