简体   繁体   中英

How to get and set OID value in custom SNMP MIB

I am very new to SNMP and I need to get "system uptime" using our own enterprise OID.

I have already obtained an IANA number and created a MIB file.

The problem is when I use snmpget command with our OID, I get an object not found error at the command prompt.

Although when I do a snmptranslate on our object, I get the exact OID of that object.

If any additional information is required from my side, please let me know.

When you use snmpget , an SNMP request is made via IP to an SNMP agent on a remote (or local) host to return a specific piece of data. A MIB is used to describe in human readable terms, what that data is and where to find it. On the other hand, snmptranslate is a tool used to parse a given MIB. It parses a local MIB file, and doesn't make any contact with an agent.

Since you mentioned creating a new MIB, I assume your trying to add new functionality to an SNMP agent. To do this, the agent must be extended. If you're using Net-SNMP, there are a few options including compiling new source code into the agent, using a sub-agent, and using external scripts via pass and pass-persist protocol. Take a look at:

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM