ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I want to read all the objects form the mib file that a manager having ,I have developed one tool to get some data form a snmp enabled agent.I want to enhance that tool by showing all the oids form the manager mib file .I am using net-snmp library .
I saw the following
/usr/local/share/snmp/mibs/
folder and it having many mib files but how I can able to form a list of oid it having,I gone through the mibs and saw the structures but how to know the oids of each and every object mentioned in the mib files.I want to list all the oids as follows
..... etc I want to scan all the mib files and to find out all the oid form that files. How to do this ?? kindly tell me ,any suggestion is highly appreciated.
well as I understand the structure of them, very meticulously and painfully. As the oids are never listed explicitly, but built up layer by layer from nothing, you've got a pretty chunky task to piece it all together. I'd try to avoid needing to do this.
I think you can use snmptranslate for what you're seeking. I'm no expert at snmp but had run across this command some months ago. On checking man page today I was able to do:
It shouldn't be too hard to use a for loop to act on all the MIBs and concatenate the information together in the format you requested. Something like the following:
Code:
for MIB in $(ls *MIB.txt)
do snmptranslate -Tz -m ./$MIB |awk -v MIB="$MIB" -F\" '{print MIB"::"$2" = "$4}'
done
NB: On my RHEL6 system the MIBs in /usr/share and named *MIB.txt. If yours are named differently you'd modify accordingly.
Hi pradiptart,
I'm also developing an application working on SNMP. I need your help to read the MIB files through java code and decode them to OIDs. Do let me know asap
Hi pradiptart,
I'm also developing an application working on SNMP. I need your help to read the MIB files through java code and decode them to OIDs. Do let me know asap
Read the LQ Rules and the "Question Guidelines" link in my posting signature. You have re-opened a thread that had been closed for SIX YEARS, hijacked it with your own question, and are asking someone to personally contact you. None of these are good things.
Open your own thread for your own question. This is a community forum, so if you need a one-on-one programmer/consultant, it would be best if you HIRE ONE. Otherwise, provide details along with the code you've written so far, in your own thread, and we can try to help you with things.
As noted, you have replied to a thread which has been inactive for six years. Please consider opening your own thread for you own problem, and include the details specific to you own situation, in order to attract the attention of current members with relevant knowledge.
Also, please review the Site FAQ for guidance in posting complete and well formed questions and general forum usage.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.