SNMP work with values in table but not with normal values

karol skocik karol.skocik@REDACTED
Fri May 5 10:32:20 CEST 2006


Hi,
  I hope somebody skilled in SNMP can explain me why I am getting this
strange behaviour.
I have MIB, funcs file, and module which contains the only one
instrumentation function
which returns {value, 10000}. This file is stripped version of file we
use to demonstrate
something what makes me worry.

  While I get right answer when I ask for the value of SNMP variable
from agent :
12> snmpa:get(snmp_master_agent, [[1,3,6,1,4,1,100000,1,10,0]]).
[10000]

when I do it from another Erlang shell which acts as a manager it failes :
(manager@REDACTED)6> snmpm:g("karol", {127,0,0,1}, 4000,
[[1,3,6,1,4,1,100000,1,10,0]]).
** SNMP M-NET-IF LOG: received send_pdu message with
   Pdu:     {pdu,'get-request',
                 97749231,
                 noError,
                 0,
                 [{varbind,[1,3,6,1,4,1,100000,1,10,0],
                           'NULL',
                           'NULL',
                           undefined}]}
   Vsn:     'version-1'
   MsgData: {"public",0}
   Addr:    {127,0,0,1}
   Port:    4000
** SNMP M-NET-IF MPD DEBUG: generate_v1_v2c_msg -> encode pdu
** SNMP M-NET-IF MPD DEBUG: generate_v1_v2c_outgoing_msg -> encode message
** SNMP M-NET-IF TRACE: handle_send_pdu -> message generated
** SNMP M-NET-IF DEBUG: sent 46 bytes to {127,0,0,1}:4000 [#Port<0.137>]
** SNMP M-NET-IF LOG: received 46 bytes from {127,0,0,1}:4000 [#Port<0.137>]
** SNMP M-NET-IF MPD DEBUG: process_v1_v2c_msg -> entry with
   Vsn:       'version-1'
   Addr:      {127,0,0,1}
   Port:      4000
   Community: "public"
   HS:        30
** SNMP M-NET-IF MPD TRACE: process_v1_v2c_msg -> PduMS: 454
** SNMP M-NET-IF MPD TRACE: process_v1_v2c_msg -> was a pdu
** SNMP M-NET-IF TRACE: received pdu
{ok,{noSuchName,1,[{varbind,[1,3,6,1,4,1,100000,1,10,0],'NULL','NULL',1}]},
    4997}

But the interesting point is, that I can query values in tables (this
is not in the example),
from both agent and manager shells.

I know that it worked before, but the code on my side is so minimal
(and working in agent),
that I can't really find out what is wrong. Plus values in tables work
ok. Strange.

I am sending a gzipped directory with both agent and manager code.
When it is unpacked
into /usr/local/src and the ebin path of agent is added to search
path, it should 'work'
as it is.

3> snmpa:load_mibs(["/usr/local/src/snmp_test/priv/mibs/MD-DVBH-MIB.bin"]).
ok
....
10> code:add_patha("/usr/local/src/snmp_test/ebin").
true
11> l(snmp_agent).
{module,snmp_agent}
...
12> snmpa:get(snmp_master_agent, [[1,3,6,1,4,1,100000,1,10,0]]).
[10000]

now request in manager shell failes :
(manager@REDACTED)6> snmpm:g("karol", {127,0,0,1}, 4000,
[[1,3,6,1,4,1,100000,1,10,0]]).
....
not found


Karol
-------------- next part --------------
A non-text attachment was scrubbed...
Name: snmp_test.tar.gz
Type: application/x-gzip
Size: 7571 bytes
Desc: not available
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20060505/6c9d823c/attachment.bin>


More information about the erlang-questions mailing list