×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

SNMP getNext and walk - End of MIB!!!

SNMP getNext and walk - End of MIB!!!

SNMP getNext and walk - End of MIB!!!

(OP)
Hi!

I am working on SNMPv1 for my device. I have a question about detecting end of MIB file. For example if I issue walk from manager and I get to the end of my objects list, how do I handle this situation? Do I set some error status field in the response and if so, what error status should I put in the response message so the manager will know that this is end of my objects list?

Some error codes include:
+-------------------+---------------------------------------------------------------------------+
| Error Status | |
+------------+------+ Description |
| Name | Code | |
+------------+------+---------------------------------------------------------------------------+
| noError | 0x00 | No error occurred. |
| tooBig | 0x01 | The response to your request was too big to fit into one response. |
| noSuchName | 0x02 | The OID in the request was not found.the OID doesn't exist. |
| badValue | 0x03 | A data type in the request did not match the data type in the SNMP agent. |
| readOnly | 0x04 | The SNMP manager attempted to set a read-only parameter. |
| genErr | 0x05 | General Error (some error other than the ones listed above). |
+------------+------+---------------------------------------------------------------------------+

Thanks!

RE: SNMP getNext and walk - End of MIB!!!

You would return noError and EndOfMibView. rfc 1905 would have more details.

From net-snmp faq:
Why do I sometimes get "End of MIB" when walking a tree, and sometimes not?

This depends on which MIB modules are supported by the agent you are querying and exactly what you're asking for.
Note that a tree is walked by repeatedly asking for "the next entry" until all the values under that tree have been retrieved. However, the agent has no idea that this is what's happening - all it sees is a request for "the next entry after X".
If the object X happens to be the last entry in a sub-tree, the agent will provide the next object supported (as requested) even though this will be in a different subtree. It's up to the querying tool to recognise that this last result lies outside the area of interest, and simply discard it.
If the object X happens to be the last entry supported by the agent, it doesn't have another object to provide, so returns an "end of MIB" indication. The Net-SNMP tools report this with the message above.
But in either case, the actual information provided will be the same.

RE: SNMP getNext and walk - End of MIB!!!

(OP)
Thank you for your post! I have found this RFC as well but it's for SNMPv2 (Protocol Operations for Version 2) and here it's clear to me how to do it, but what if I have SNMPv1 where I don't have this EndOfMibView and I have only this ones:
noError(0), tooBig(1), noSuchName(2), badValue(3), readOnly(4), genErr(5).

Should I generate Error (not likely) or should I have some logic to send something like this: For the last get-next request I will put the same OID in the response PDU and NULL for the value?
Last two requests that I got in Wireshark when I issue a command snmpwalk on tree looks like this: There you can see that in the last get-next-request I got the same OID in get-response as in the get-next-request, but value is now NULL and not 1 as it was in the request before last one...

20481 4.792634 127.0.0.1 127.0.0.1 SNMP get-next-request 1.3.6.1.6.3.16.1.5.2.1.6.6.95.110.111.110.101.95.1.1
20482 4.792753 127.0.0.1 127.0.0.1 SNMP get-response 1.3.6.1.6.3.16.1.5.2.1.6.6.95.110.111.110.101.95.1.2 value = (integer) 1
20483 4.792845 127.0.0.1 127.0.0.1 SNMP get-next-request 1.3.6.1.6.3.16.1.5.2.1.6.6.95.110.111.110.101.95.1.2
20484 4.792947 127.0.0.1 127.0.0.1 SNMP get-response 1.3.6.1.6.3.16.1.5.2.1.6.6.95.110.111.110.101.95.1.2 value = NULL

Is this maybe a solution for my SNMPv1?

Thanks!

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close