cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1650
Views
0
Helpful
3
Replies

EEM snmp trap variables

David Trocki
Level 1
Level 1

I'm encountering an issue with using EEM to generate SNMP traps from a syslog event.  I want to include the syslog message as a varbind in the trap, but the $_syslog_msg variable will not resolve, rather the variable is a string with the literal value "$_syslog_msg".  

Here is an example:

event manager applet test-syslog
event syslog pattern "SYS-5-CONFIG"
action 1.0 info type snmp var "testvar1" oid 1.3.6.1.4.1.33333.1.1.0 string "$_syslog_msg"
action 2.0 info type snmp trap enterprise-oid 1.3.6.1.4.1.33333.1 generic-trapnum 6 specific-trapnum 1 trap-oid 1.3.6.1.4.1.33333.1.0.1 trap-var "testvar1"
!

The resulting SNMP trap has the variable as: "$_syslog_msg" rather than what the syslog msg variable is.

As a sanity check I also added

action 3.0 puts "test $_syslog_msg"

It correctly displays the syslog message to the tty.

Am I missing something?  Any suggestions?

Thanks

1 Accepted Solution

Accepted Solutions

Joe Clarke
Cisco Employee
Cisco Employee

This is a known issue.  You'll need to use Tcl to get variable expansion in your varbinds.  You can use the tool at http://www.marcuscom.com/convert_applet to convert your applet to an EEM Tcl policy.

View solution in original post

3 Replies 3

Joe Clarke
Cisco Employee
Cisco Employee

This is a known issue.  You'll need to use Tcl to get variable expansion in your varbinds.  You can use the tool at http://www.marcuscom.com/convert_applet to convert your applet to an EEM Tcl policy.

That worked well, although I should point out that the applet<>TCL converter did not properly substitute underscores for hyphens.

e.g.

enterprise-oid should convert to enterprise_oid

Thanks!

Thanks for the report.  It has been fixed.

Review Cisco Networking for a $25 gift card