Re: the mechanisms of retrieving table

"Dave Shield" <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
2008/6/25 Guole <[email protected]>:
>     However, how dose "get_field_names" know
> the exact oid before sending any request?

snmptable will use the MIB file to extract the MIB
definitions of the column objects for that table,
and hence the relevant OIDs.
  These are then used in the GETNEXT request
that starts walking the table.

>        To give an example, I want to
> get the ipRouteTable(1.3.6.1.2.1.4.21). "get_table_entries" send a
> request with oid "1.3.6.1.2.1.4.21.1.1.210.43.192.192"

No - it doesn't.
It will send a GETNEXT request with:
     1.3.6.1.2.1.4.21.1.1 (ipRouteDest)
     1.3.6.1.2.1.4.21.1.2 (ipRouteIfIndex)
         :
     1.3.6.1.2.1.4.21.1.13 (ipRouteInfo)

i.e. the OIDs of the column objects themselves.


>                but how does it
> know there is an address "210.43.192.192" in the net?

The snmptable command doesn't know the index values,
but the agent does.   So the agent will return the first row
in the table - e.g. the row with index 210.43.192.192

snmptable can then use these OIDs to form the next GETNEXT
request, and retrieve the second row in the table.
And so on.


This is how SNMP walks work.   Any SNMP book should
cover this in detail.


Dave
-------------------------------------------------------------------------
Check out the new SourceForge.net Marketplace.
It's the best place to buy or sell services for
just about anything Open Source.
http://sourceforge.net/services/buy/index.php
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.