05-18-2013 12:29 PM
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
Solved! Go to Solution.
05-19-2013 07:52 AM
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.
05-19-2013 08:37 AM
You can separate pattern strings with a | such as {OSPF|EIGRP|RIP}
05-18-2013 02:10 PM
05-18-2013 02:21 PM
Just remove the first line of your script and reregister it, and it will react to those OSPF syslogs.
05-18-2013 02:42 PM
Joseph,
Will try that now.
I'm going to remove:
::cisco::eem::event_register_none
Correct?
05-18-2013 02:43 PM
Yes.
05-18-2013 02:45 PM
Joseph,
It didn't work :-(
05-18-2013 02:46 PM
I issued the following command:
send log %OSPF
I was expecting to see testlog_osfp
05-18-2013 02:46 PM
Exactly what did you do to reregister the policy? What does your final syslog message look like?
05-18-2013 02:49 PM
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)
05-18-2013 02:50 PM
Why did you suggest removing the first line?
05-18-2013 02:52 PM
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.
05-18-2013 02:52 PM
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.
05-18-2013 02:55 PM
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
05-18-2013 02:59 PM
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"
05-19-2013 05:05 AM
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
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