On Wed, Jul 10, 2013 at 10:34:05AM +0800, zhuyj wrote:
> root@localhost:/root> snmpset -v 2c -c public 192.168.2.15 
> .1.3.6.1.6.3.12.1.2.1.9.0.25 i 5
> SNMP-TARGET-MIB::snmpTargetAddrRowStatus.'..' = INTEGER: createAndWait(5)
> root@localhost:/root> snmpget -v 2c -c NETMAN 192.168.2.15 
> .1.3.6.1.6.3.12.1.2.1.9.0.25 i 5
> snmp_build: unknown failuresnmpget: Error building ASN.1 representation 
> (Can't build OID for variable)
> 
> Notice that there is no error when setting, only when trying to get.

That is natural. You are setting one object to the value 5, but you
are trying to get 3 objects, 1.3.6.1.6.3.12.1.2.1.9.0.25, i, and 5.

snmpget complains that it cannot build the ASN.1 representation for the
object 5, which is quite correct as the first element of an object
identifier must be 0 or 1.

What you want is just
snmpget -v 2c -c NETMAN 192.168.2.15 .1.3.6.1.6.3.12.1.2.1.9.0.25

I admit that the error message could have been clearer.

/Niels

-- 
Niels Baggesen - @home - Ã…rhus - Denmark - n...@users.sourceforge.net
The purpose of computing is insight, not numbers   ---   R W Hamming

------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to