01-20-2016 12:27 PM
When I run the following, I get the RSSI return I expect:
#snmp get v2c 172.16.11.2 public oid 1.3.6.1.4.1.9.9.661.1.3.4.1.1.1.13
SNMP Response: reqid 47, errstat 0, erridx 0
c3gCurrentGsmRssi.13 = -59
But my tcl script, below, returns something completely different, and I can't work out why!
It returns:
#ev m run rssitest.tcl
4294967238
Do I need to parse the $result somehow? If so, how???
::cisco::eem::event_register_none
namespace import ::cisco::eem::*
namespace import ::cisco::lib::*
set rssi 0
if [info exists rssi] {
if [catch {sys_reqinfo_snmp oid 1.3.6.1.4.1.9.9.661.1.3.4.1.1.1.13 get_type exact} result] {
error $result $errorinfo
}
} else {
puts Cannot do snmp query, because... reasons!
} array set snmp_res $result
set rssi $snmp_res(value)
puts $rssi
Solved! Go to Solution.
01-20-2016 04:23 PM
This is a side effect of signed versus unsigned integers. EEM Tcl is casting the value to an unsigned integer. To get the signed value, do:
set rssi [expr ($snmp_res(value) - 4294967295) - 2]
01-20-2016 04:23 PM
This is a side effect of signed versus unsigned integers. EEM Tcl is casting the value to an unsigned integer. To get the signed value, do:
set rssi [expr ($snmp_res(value) - 4294967295) - 2]
01-20-2016 04:33 PM
Sir - I knew 1) you'd be the one to answer and 2) you'd have the answer.
Course... it's a simple one, but still... :P
Thanks!!!
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide