snmp_generic badmatch [Was: connection snmp and mnesia...badmatch]

Heinrich Venter <>
Wed Feb 23 16:30:45 CET 2005


Hi

I have a problem related to the error reported on using a mnesia table
with snmp.
I am trying to use a volatile table instead of mnesia, but I get the
following error when I do a snmpwalk on the OID

** User error: Invalid return value
{'EXIT',{{badmatch,false},[{snmp_generic,table_info,1},{snmpa_local_db,t
able_func,4},{snmpa_agent,get_next_values_all_rows,6},{snmpa_agent,get_n
ext_table,4},{snmpa_agent,next_loop_varbinds,5},{snmpa_agent,process_pdu
,4},{snmpa_agent,handle_pdu,7},{snmpa_agent,handle_info,2},{gen_server,h
andle_msg,6}]}} from
{snmp_generic,table_func,[{connectionTable,volatile}]} (get_next)

As far as I can tell, the value of false comes from the
snmpa_general_db:read function that can not find some key in the
internal store (which should be ets in my case)

Here is what I am trying to do:
Have a process that gathers statistics on my running application.  This
process must then put the gathered stats into the volatile internal
store tables.  The generic snmp access functions must then tretrieve the
info from the  snmp table.

I create a new table with snmpa_local_db:table_create({connectionTable,
volatile}).

I have a function caled update that executes once a minute

update () ->
  Rows = function_that_gets_all_rows(),
  lists:foldl ( fun(R,RowIndex) ->
 
snmpa_local_db:table_create_row({connectionTable,volatile},
                                                  [RowIndex],
                                                  R),
                   RowIndex+1
                 end,
                 1,
                 Rows
               ),
  receive
    after 60000 ->
      update()
  end.

I can check this table with snmpa_local_db:print(connectionTable) and
all the entries are there.

Somehow I am missing some connecting bit.

My funcs file has a line

{smerlyConnectionTable  ,{snmp_generic, table_func,
[{connectionTable, volatile}]} }.

And my MIB defines smerlyConnectionTable

Any help here would be appreciated.

-]-[einrich



SMS "poem" and a category (wild, friendship, love, sorry, funny) to 36444
http://asp1.rocketseed.com/RocketSeed/mail/433a32353a313038363630303a33303639373a2d323a333831

This will take you to the Launchpad site for more info
http://asp1.rocketseed.com/RocketSeed/mail/433a32353a313038363630303a33303639373a2d323a333738
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20050223/38c1dacf/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MTk2LjMwLjc5LjE1NQ==
Type: image/gif
Size: 620 bytes
Desc: not available
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20050223/38c1dacf/attachment.gif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MTk2LjMwLjc5LjE1NQ==
Type: image/gif
Size: 12369 bytes
Desc: not available
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20050223/38c1dacf/attachment-0001.gif>


More information about the erlang-questions mailing list