Snmpwalk calls get_next_obj() API in loop eventually times out

Hi All,

I am doing snmp walk on the following yang model which is a list of lists

container transport
  list connection {
    tailf:callpoint connection;
    key "key1 key2 key3 key4";
    leaf key1;
    leaf key2;
    leaf key3;
    leaf key4;
    list history {
      tailf:callpoint history;
      key "index";
      leaf index;
      leaf attr1;
      leaf attr2;
    } // history
  } //connection
} // transport

I see that when I invoke snmp walk on one of the attributes of list history, the snmp agent keeps invoking the get_next_obj() API for callpoint history and eventually times out. Also I notice that the confd keypath is getting trimmed in the subsequent calls to the get next obj. But If I invoke the same callpoint via CLI, the processing order is correct and all the history elements are processed correctly. I am using confd_data_reply_next_object_tag_value_array to post return values.

For one element in history list successful invocation logs from CLI:

show_connection_get_next_object: Get-Next-Obj Path: /transport/connection
show_connection_history_get_next_object: Get-Next-Obj Path: /transport/connection{key1 key2 key3 key4}/history
show_connection_history_get_next_object: Get-Next-Obj Path: /transport/connection{key1 key2 key3 key4}/history
show_connection_history_find_next_object: Find-Next-Obj Path: /transport/connection{key1 key2 key3 key4}/history
show_connection_history_find_next_object: Entry Find-Next-Obj Path: /transport/connection

For same one element in history list, SNMP walk logs as below:

show_connection_get_next_object: Entry Get-Next-Obj Path: /transport/connection
show_connection_history_get_next_object: Get-Next-Obj Path: /transport/connection{key1 key2 key3 key4}/history
show_connection_history_get_next_object: Get-Next-Obj Path: /transport/connection{key1 key2 key3 key4
show_connection_history_get_next_object: Get-Next-Obj Path: /transport/connection{key1 key2 key3 key4
show_connection_history_get_next_object: Get-Next-Obj Path: /transport/connection{key1 key2 key3 key4
show_connection_history_get_next_object: Get-Next-Obj Path: /transport/connection{key1 key2 key3 key4
show_connection_history_get_next_object: Get-Next-Obj Path: /transport/connection{key1 key2 key3 key4
.
.

And it times out

Any idea what could be going on?

snmpwalks seems to be executing get_next() in loop instead of going to find_next().

From the “tailf:sort-order on tables” section in the ConfD UG:

Tables in SNMP are strictly lexicographically ordered. An SNMP table is typically traversed with GETNEXT requests, where given a previous index of a row the next greater index is returned. Since the table is specified in a YANG module and may be stored in an external database or perhaps as a managed object (MO) written in C, it is important that the get_next() function returns the elements in correct order. If the get-next function doesn’t return the elements properly in order, SNMP will not work.
…

Thanks for the info. It works now!

1 Like