SNMP work with values in table but not with normal values

Micael Karlberg bmk@REDACTED
Fri May 5 13:33:06 CEST 2006


Hi,

You have most likely configured the agent and/or manager
incorrectly. Increase verbosity of the agent:

	snmpa:verbosity(master_agent, trace).
	snmpa:verbosity(net_if, trace).

And run the get request again.

This will produce _a lot of_ printouts, that hopefully will
make it clear why the agent reports noSuchName.

/BMK

karol skocik wrote:
> 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



More information about the erlang-questions mailing list