Contact Us
+1.831.460.7010

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
-context
$snmptcl(agent)

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
1
(SilverCreekMx) 20 % puts $rv
{1.3.6.1.2.1.1.1.0 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 
1
(SilverCreekMx) 22 % puts $re 
notWritable

Answer Two:  (by Syed)  Here $rv is printing entire OBJECT ({1.3.6.1.2.1.1.1.0 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.