Dear all,
I got some problems using mib2c. It seems the mib2c not work well on my FC5.
I use net-snmp-5.3.1.tar.gz on FedoraCore5. My operation step by step is:
(as root)
1. copy the net-snmp-5.3.1.tar.gz to /usr/local/src
2. tar zxvf net-snmp-5.3.1.tar.gz
3. cd net-snmp-5.3.1
4. ./configure (result is ok)
5. make (result is ok)
6. make install (result is ok)
7. cd perl
8. perl Makefile.PL (result is ok)
9. make (result is ok)
10. make install (result is ok)
It seems the installation of net-snmp-5.3.1 is ok, then I add my own mib file.
Here is the content of my mib file (OSEE-TEST-MIB.txt)
--my mib file start
OSEE-TEST-MIB DEFINITIONS ::= BEGIN
IMPORTS
DisplayString
FROM SNMPv2-TC
MODULE-IDENTITY, OBJECT-TYPE, enterprises
FROM SNMPv2-SMI;
--
osee OBJECT IDENTIFIER ::= { enterprises 27290 }
ustScalarSet OBJECT IDENTIFIER ::= { osee 1 }
ustSSSimpleString OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS read-write
STATUS current
DESCRIPTION
"This is a simple test string."
::= { ustScalarSet 1 }
ustSSSecondsSinceChanged OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"no use."
::= { ustScalarSet 2 }
END
--my mib file end
I copy this file to /usr/local/share/snmp/mibs.Then I do the following opration:
cd /usr/local/share/snmp/mibs
export MIBS=all
# snmptranslate -Tp -IR osee
(the result is:)
+--osee(27290)
|
+--ustScalarSet(1)
|
+-- -RW- String ustSSSimpleString(1)
+-- -R-- String ustSSSecondsSinceChanged(2)
# snmptranslate -IR ustScalarSet
(the result is:)
OSEE-TEST-MIB::ustScalarSet
# snmptranslate -IR ustScalarSet -On
.1.3.6.1.4.1.27290.1
It seems snmptranslate work well, so I try to run mib2c to generate .c
and .h files.
#mib2c ustScalarSet
(the result is:)
You didn't give mib2c a valid OID to start with. IE, I could not find
any information about the mib node "ustScalarSet". This could be caused
because you supplied an incorrectly node, or by the MIB that you're
trying to generate code from isn't loaded. To make sure your mib is
loaded, run mib2c using this as an example:
env MIBS="+MY-PERSONAL-MIB" mib2c ustScalarSet
You might wish to start by reading the MIB loading tutorial at:
http://www.net-snmp.org/tutorial-5/commands/mib-options.html
And making sure you can get snmptranslate to display information about
your MIB node. Once snmptranslate works, then come back and try mib2c
again.
Did I do something wrong?
Is there any problem with my mib file?
Do I need to use the mib2c configuration file such as mib2c.scalar.conf?
any suggestion will be appreciated.
Best regards,
Sam
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders