cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2761
Views
0
Helpful
31
Replies

Custom Tcl Script for an Event Help

Hello Community,

Can someone please show me how to compile a EEM (Tcl) script that will be activated when a syslog event occurs. For example, I would like the script to be activated when the following syslog event occurs:

%OSPF-5-ADJCHG:

Also I would like a similar script to be activated when the following syslog event occurs:

VDC_MGR-2-VDC_BAD: vdc_mgr

VDC_MGR-2-VDC_UNGRACEFUL: vdc_mgr:

Cheers

2 Accepted Solutions

Accepted Solutions

As I suspected.  You appear to be using some rich text editor to store your file.  The quotes in the first line have changed to fancy quotes, and thus this is no longer an ASCII text file.  Here is the ASCII version.

View solution in original post

You can separate pattern strings with a | such as {OSPF|EIGRP|RIP}

View solution in original post

31 Replies 31

OK, I tried to create a simple Tcl script from an EEM script using the tool provided on this site. However, when I issue the command send log %OSPF I should get the message 'testlog_ospf', but nothing happens.

Can someone help please?

Cheers

Just remove the first line of your script and reregister it, and it will react to those OSPF syslogs.

Joseph,

Will try that now.

I'm going to remove:

::cisco::eem::event_register_none

Correct?

Yes.

Joseph,

It didn't work :-(

I issued the following command:

send log %OSPF

I was expecting to see testlog_osfp

Exactly what did you do to reregister the policy?  What does your final syslog message look like?

I registered the policy as ospf5ospf.tcl

R1#show flash:

System flash directory:
File  Length   Name/status
   5   2        ospf5ospf.tcl 
[1660 bytes used, 8386944 available, 8388604 total]
8192K bytes of processor board System flash (Read/Write)

Why did you suggest removing the first line?

Because it was wrong to have it in there.  You were essentially saying that the event you wanted was a none event (i.e., the only way the policy would have worked was to run it manually).  The second line was not being processed.

But what steps did you do to reregister the script?  Simply copying the new script into flash is not sufficient for the EEM server to process the changes.

I register with a program I use called Ruban, by Davra Networks.

How would you suggest registering it?

BTW, If I don't respond to your next response its because I have to head out - just didn't want to appear rude.

However, please still respond

RuBAN should be doing the right thing, but the manual step is to do:

no event manager policy ospf5ospf.tcl

event manager policy ospf5ospf.tcl 

Then you will see it registered under "show event manager policy registered"

Hello Joseph,

You're probably asleep due to the time difference. However, I applied the command you suggested, but I get the following error message:

R1(config)#event manager policy ospf5ospf.tcl
Compile check and registration failed:policy file does not start with event register cmd
Tcl policy execute failed: policy file does not start with event register cmd

Embedded Event Manager configuration: failed to retrieve intermediate registration result for policy ospf5ospf.tcl: Unknown error 0

Review Cisco Networking for a $25 gift card