> From: cornerbreeze [mailto:cornerbre...@163.com]
> Sent: Wednesday, February 24, 2010 7:37 PM

> I wrote a MIB by imitating the NET-SNMP-TUTORIAL-MIB. And here is my
> MIB:

[SNIP/]
>                 memoryUsage OBJECT-TYPE
>                         SYNTAX DisplayString
>                         MAX-ACCESS read-only
>                         STATUS current
>                         DESCRIPTION
>                                 "This attribute shall indicate the
> usage rate of Memory."
>                         ::= { tSetting  1 }
                              ^^^^^^^^^^^^^^^
                              |||||||||||||||
                              compare this...

> 
>                 cpuUsage OBJECT-TYPE
>                         SYNTAX DisplayString
>                         MAX-ACCESS read-only
>                         STATUS current
>                         DESCRIPTION
>                                 "This attribute shall indicate the
> usage rate of CPU."
>                         ::= { tSetting  2 }
> END

> #snmpget -v 2c -c public localhost TEST-MIB::memoryUsage.0
> and succeeded;
> when I inputed:
> #snmpget -v 2c -c public localhost TEST-MIB::cpuUsage.0
> it said:
> No Such Instance currently exists at this OID.
> 
> then I modified my MIB as below(deleted the leaf memeryUsage ):

[SNIP/]
>                 cpuUsage OBJECT-TYPE
>                         SYNTAX DisplayString
>                         MAX-ACCESS read-only
>                         STATUS current
>                         DESCRIPTION
>                                 "This attribute shall indicate the
> usage rate of CPU."
>                         ::= { tSetting  1 }
                              ^^^^^^^^^^^^^^^
                              |||||||||||||||
                              with this...
> 
> END
> 
> then I inputed:
> #snmpget -v 2c -c public localhost TEST-MIB::cpuUsage.0
> it succeed.

        Right.  Both times, TEST-MIB::tSetting.1.0 is there, but 
TEST-MIB::tSetting.2.0  is not.  Changing the MIB only changes the *name* of 
the object.  You must change the underlying code to provide the desired values.

> so, why did it fail before I deleted the "memoryUsage"?
> How to make the two leaves exist at the same MIB together?

        Provide an implementation for TEST-MIB::tSetting.2.0.


        HTH,

Mike

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
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