snmp related question, getnext of empty table accesses the key of next table

Tue Aug 16 21:39:41 CEST 2005


I have few tables in snmp module, and when I issue a
get_next using a mib browser for an empty table, since
endOfTable is returned, it continues to look for the
next available instance of the next variable/table.

This is  according to (conforming to ) the
documentation given below from
under instrumentation functions section.

3.1.6 GetNext Operation 

The GetNext Operation operation should only be defined
for tables since the agent can find the next instance
of plain variables in the MIB and call the
instrumentation with the get operation. 

table_access(get_next, RowIndex, Cols [, ExtraArg1,


Cols is a list of integers, all greater than or equal
to zero. This indicates that the instrumentation
should find the next accessible instance. This
function returns the tuple {NextOid, NextValue}, or
endOfTable. NextOid should be the lexicographically
next accessible instance of a managed object in the
table. It should be a list of integers, where the
first integer is the column, and the rest of the list
is the indices for the next row. If endOfTable is
returned, the agent continues to search for the next
instance among the other variables and tables. 

RowIndex may be an empty list, an incompletely
specified row index, or the index for an unspecified

But, in finding the next instance the program tries to
access the key ie Colno corresponding to key is part
of this search.

In my case, the get_next of the switch table works
normally but in the normal case, the keys are
inaccessible, and hence getnext (even as part of walk)
specifies columns 3-7 and never 1 and 2

The error I get is:

** User error: Invalid return value {'EXIT',{{badma
handle_msg,6}]}} from
{oam_snmp_snas,snasSwitchDetailTable,[]} (get_next)

my get_switch_table is the access function which is
defined below: The first parameter is col no.

get_switch_table(?snasSwitchIp, {XId, SId}) ->
        {value, SwitchIp} =

the problem is due to the col value 1 (first parameter
of the following function call). This is confirmed
because, just typing at erlang shell as follows:


gives the following error,

=ERROR REPORT==== 16-Aug-2005::10:25:42 ===
                                           Error in
process <0.1043.0> on node '
' with exit value:

* exited:
                             {shell,eval_loop,3}]} **

whereas oam_snmp_snas:get_switch_table(3,{'1','1'}).
does not give error(produces proper output)

My doubt is: why does the next searched instance is
the key(col 1), instead of column 3.

Also is it possible to suppress searching beyond for
next available instance if endOfTable is encountered.


Start your day with Yahoo! - make it your home page 

More information about the erlang-questions mailing list