0

I am using the snmp use the MIB to display data

I am having on the MIB From that file i want to generate the .c file c header file. How to generate the files and how to get the OID for the created MIB files , IF the mib file having the table before creating these files means first how to generate table

     1.How to set/create the table for the MIB Files information to be stored
     2.How to generate mib2c OID code
     3.How to genarate .c and .h file for MIB file
Michael Kirkham
  • 1,052
  • 7
  • 16
  • http://www.net-snmp.org/wiki/index.php/TUT:mib2c_General_Overview That's exactly what mib2c serves. – Lex Li Nov 02 '13 at 01:49
  • 1. snmptranslate -m RC-REC-MIB -IR -On deviceId [ works fine] 2. snmptranslate -On RC-REC-MIB::deviceId [works fine] First two commands are showing the OID for the deviceId 3. env MIBS="+RC-REC-MIB" mib2c deviceId shows the numeric translation of OID and OID values. And its asking for the the First, do you want to generate code that is compatible with the ucd-snmp 4.X line of code, or code for the newer Net-SNMP 5.X code base (which provides a much greater choice of APIs to pick from): 1) ucd-snmp style code 2) Net-SNMP style code i have choosed 2 – Immanuel Deepak Nov 04 '13 at 06:37
  • It looks like you have some scalars in the mib you requested, so I will now generate code for them if you wish. You have two choices for scalar API styles currently. Pick between them, or choose not to generate any code for the scalars: 1) If you're writing code for some generic scalars (by hand use: "mib2c -c mib2c.scalar.conf deviceId") 2) If you want to magically "tie" integer variables to integer scalars (by hand use: "mib2c -c mib2c.int_watch.conf deviceId") 3) Don't generate any code for the scalars – Immanuel Deepak Nov 04 '13 at 06:47
  • Select your choice: 1 using the mib2c.scalar.conf configuration file to generate your code. ERROR: failed to open deviceId.h at /usr/local/share/snmp//mib2c.scalar.conf:5 jacob@jacob-desktop:/usr/local/share/snmp/mibs$ mib2c -c mib2c.scalar.conf deviceId You didn't give mib2c a valid OID to start with. IE, I could not find any information about the mib node "deviceId". 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: – Immanuel Deepak Nov 04 '13 at 06:51
  • env MIBS="+MY-PERSONAL-MIB" mib2c -c mib2c.scalar.conf deviceId 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. jacob@jacob-desktop:/usr/local/share/snmp/mibs$ mib2c -c mib2c.scalar.conf .1.3.6.1.4.1.41850.42.0.1 ERROR: failed to open enterprises.h – Immanuel Deepak Nov 04 '13 at 06:52
  • The above 4 things i executed and got the error result how can i create a table for the MIB – Immanuel Deepak Nov 04 '13 at 06:54

0 Answers0