cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3371
Views
0
Helpful
12
Replies

Generate SNMP trap from a TCL script within EEM - ASR9000

dsliwinski
Level 1
Level 1

I want my script to generate a snmp trap instead of a syslog. How do I do that? He is the command I use to genearate the syslog

action_syslog msg "EEM - Check for Layer 2 Loop completed."

12 Replies 12

Joe Clarke
Cisco Employee
Cisco Employee

action_snmp_trap strdata "EEM - Check for Layer 2 Loop completed."

It does not seem to work. Does this work in XR software?

Sorry, I missed the ASR9000 in the subject.  No, unfortunately, there is no trap support on XR at the moment.  Syslog is the only recourse.

I found these two commands. Do you know what they do? It looks like you can build a custom snmp trap bindings.

sys_reqinfo_snmp_trapvar

sys_reqinfo_snmp_trap

Yes, you can.  I always forget that those commands are supported on XR as well as IOS.  I wrote a doc on using them at

https://supportforums.cisco.com/docs/DOC-11745 .

It does not seem to work. Is this supported in 4.1.1 version of XR software? Here is what I configured and error I got:

sys_reqinfo_snmp_trapvar var vbinds oid 1.3.6.1.4.1.33333.2.0 string "send_custom_trap.tcl"

sys_reqinfo_snmp_trapvar var vbinds oid 1.3.6.1.4.1.33333.3.0 string "This is a custom trap"

sys_reqinfo_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 vbinds

RP/0/RSP0/CPU0:Mar  5 14:54:08.103 : syslog_dev[93]: noscan: No trap variable "vbinds"

RP/0/RSP0/CPU0:Mar  5 14:54:08.103 : syslog_dev[93]: noscan:     while executing

RP/0/RSP0/CPU0:Mar  5 14:54:08.103 : syslog_dev[93]: noscan: "sys_reqinfo_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 vbinds

RP/0/RSP0/CPU0:Mar  5 14:54:08.103 : syslog_dev[93]: noscan: "

RP/0/RSP0/CPU0:Mar  5 14:54:08.104 : syslog_dev[93]: noscan:     (file "/dev/rdsfs/etc/eem_rdsfs/eem_counter_lookup_v1_0.tcl" line 100)

From what I can tell this should work.  However, I don't have an XR device with which to test.  Can you enable "debug event manager tcl commands" reproduce the issue, and post the output?

I could not find option "debug event manager tcl commands" - only"debug event manager tcl". But no logs were generated. When I enabled "debug event manager all", there were logs generated. The details are in the  attached file.

I'm seeing some strange double-quotes inserted on these lines, and I'm not sure why.  Can you post the script file?

Nevermind.  I just confirmed, custom trap support was added to XR 4.2 and higher.  While the commands are there, it will not work in 4.1.  This is bug CSCue21891.

Ok, that makes sense. We are upgrading the lab nodes to 4.3.1 soon, so I will find out. Thank you for your help!

Joseph, That is an internal bug.  When I opened a case with TAC on the same in January, the reply I received was:

In summary, feature you are trying to do is available from 4.2.0 as

internal bug mentions, and documentation feedback will be submitted today.

TAC was going to submit a request to have the 4.1 documentation updated to reflect the SNMP trap being unavailable.

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: