Contact Us

Question:  (by Syed)  Hi all,  

SNMP Request Commands Returns: 0 If the agent responded properly to the operation , 1 If the agent did not respond properly to the operation. How to confirm this action?

Will it be possible to print that value?

For ex:

snmptcl::snmpset mplsTunnelRowStatus.$mplsTunnelIndex 7

Here i am setting the invalid rowstatus value=7 , agent should return 1 due to error.  I want that value to be printed? Is it possible?

Answer One:  (by PumpkinJason)  You would want to use the option 'rvbinds' as follows:

(SilverCreekMx) 19 % snmptcl::snmpset sysDescr.0 ""Asdad""
-rvbinds rv
(SilverCreekMx) 20 % puts $rv
{ SNMPv2-TC:DisplayString Asdad}

if the set fails, you can also get the returned error status in '-restatus' option

(SilverCreekMx) 21 % snmptcl::snmpset sysDescr.0 "Asdad" -rvbinds
rv -
restatus re 
(SilverCreekMx) 22 % puts $re 

Answer Two:  (by Syed)  Here $rv is printing entire OBJECT ({ SNMPv2-TC:DisplayString Asdad) but i need to catch "1" ? 

please let me know if any other option is available?

Answer Three:  (by PumpkinJason)  couldn't you just do

set r [snmptcl::snmpset sysDescr.0 ""Asdad"" -rvbinds rv]
puts $r.