相关文章推荐
眼睛小的登山鞋  ·  PostgreSQL ...·  1 年前    · 
闷骚的紫菜  ·  把Oracle ...·  1 年前    · 
Collectives™ on Stack Overflow

Find centralized, trusted content and collaborate around the technologies you use most.

Learn more about Collectives

Teams

Q&A for work

Connect and share knowledge within a single location that is structured and easy to search.

Learn more about Teams

I am programming a network management system, and need to be able to print out meaningful names behind the OIDs that are received from SNMP traps. Due to the nature/size of this system, it would not be a good idea to manually map every OID to a meaningful name for every MIB on every device that is being used.

With that said, is there a free (commercial use) way of automatically pairing name/description with their respective OID for all OIDs in a MIB; and then those pairings be used in a Java program?

In other words, is there a tool or method that will convert a MIB tree to Java objects that can be traversed in a program to retrieve OID's names/descriptions?

Thanks

A good product. Would recommend for most situations; but unfortunately is not free for commercial use (1000 euros). SMI4j, however, is free for commercial use. But, the documentation is so sparse that it's not worth attempting to accomplish my need through it. Thanks though. Stephen Watkins May 27, 2010 at 18:25

I know thread is old, but it may help others. One can use SNMP4J-SMI jar get a name description for OIDS in MIB

How to use SNMP4J-SMI with SNMP4J

Just fyi it comes under License Commercial

Very rare usage of SNMP i found dude. I also worked on SNMP. For that, SNMP4J is better library we can use in java.

http://www.snmp4j.org/

It supports v1,v2 and v3 for SNMP.

Also you can implement Mib tree walking using that, and you can fetch perticular OID name/description and value also. Its very cool and easy to use once to get into it.

Also note, that you need to provide the IP address in the device manager right? so that the device can send SNMP traps to your application which is listening on some port.

You need to open the port also for traps.

hope this helps. let me know if any queries. You need to dig more into it. You know how networking stuff works :).

thanks.

I have been looking into trying to retrieve OID name/description using SNMP4j, but can't seem to find how to do it. Can you show me how to do that using SNMP4j? Thanks. – Stephen Watkins May 27, 2010 at 14:12 Hey, you need to check the documentation provided. Basically MIB is universal registry kind of thing for the devices which wants to support SNMP. Vendor must register the MIB for device universally,so that each OID can be unique. Every OID has special meaning, and diff. for organizations. Please check the link for more examples how to use OID and variable bindings from SNMP4J. snmp4j.org/doc/org/snmp4j/package-summary.html – Parth May 27, 2010 at 16:11 Nope, that doesn't help. I understand SNMP and have used SNMP4J extensively. What I don't understand is how to get the OID name/description via SNMP4j. If you don't mind, give me a quick code snippet of how to get any OID's name/description via SNMP4j. Thanks. – Stephen Watkins May 27, 2010 at 18:21 Ok, You want to read description of particular OID. For that you need to read the MIB file using MIB parsers. Please check the following link, it provides example for reading OID's description. Also check Mibble parse for MIB file loading. Links: webnms.com/snmp/help/snmpapi/snmpv1/tutorials/mib_handling/… , smi4j.dev.java.net , mibble.org thanks. – Parth May 28, 2010 at 5:19

Thanks for contributing an answer to Stack Overflow!

  • Please be sure to answer the question. Provide details and share your research!

But avoid

  • Asking for help, clarification, or responding to other answers.
  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.