Do action by EEM+TCL after the log happen X Times in Y LC/RSP at ASR9k
Problem:
We can do more automated action by EEM + TCL on Cisco router, and have more trigger way for syslog pattern trigger, OID trigger, CPU Threshold trigger and so on. That will match IOS platform, no any issue. But in XR platform, each LC/RSP have separate alarm, we maybe have special requirement, e.g:
Some alarms frequency happen, I want to restart the process (base on pid) if the alarm happen 3 times in 5min on each LC, how to do that?
0/3/cpu0: alarm report "C", Pid = zzz 0/1/cpu0: alarm report "A", Pid = xxx 0/2/cpu0: alarm report "B", pid = yyy 0/3/cpu0: alarm report "C", pid = zzz 0/1/cpu0: alarm report "A", pid = xxx 0/1/cpu0: alarm report "A", pid = xxx
Solution:
We can do interactive script by TCL I/O, create a file in Harddisk/disk which has the history/count of syslog for Lcs. We can read this file using the script whenever the syslog is observed. Based on the number of syslogs the script can take the required action.
The steps will be like this, please check attachment and script flow chart for detail script, in my example, I only dump arp process for testing, please change script base on your requirement, in order to test script, you can add flag to test that, e.g “action_syslog priority info msg “a””: 完整阅读