cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1198
Views
0
Helpful
1
Replies

EEM script using SNMP set-type string and a variable does not work for me

chappiechap
Level 1
Level 1

When I use these actions on my EEM script:

action 81 info type snmp oid 1.3.6.1.2.1.1.4.0 set-type string "$_string_result" community private

action 82 snmp-trap strdata "$_string_result"

I get my OID value set to $_string_result instead of the real value stored on that variable ("whatever test string"). But then I get a trap (action 82) that is showing the value of the variable just right!

OID:

C:\usr\bin>snmpwalk.exe -v2c -c private 192.168.1.1 1.3.6.1.2.1.1.4.0
SNMPv2-MIB::sysContact.0 = STRING: $_string_result

TRAP:

C:\usr\bin>snmpwalk.exe -v2c -c private 192.168.1.1 1.3.6.1.4.1.9.10.91.1.2.3.1
.11.15
SNMPv2-SMI::enterprises.9.10.91.1.2.3.1.11.15 = STRING: "whatever test string"

Is it possible that you cannot load variables using snmp set-type or something I am doing wrong?

Thanks!

1 Reply 1

Joe Clarke
Cisco Employee
Cisco Employee

This is a known issue.  Variable expansion was never coded in these SNMP actions.  If you convert your applet to Tcl using http://www.marcuscom.com/convert_applet then you will be able to do the variable modification.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: