Sunday, August 8, 2021

IOS XR Embedded Event Manager (EEM) Script Example

 Here is an example of an event manager script which can be used to collect a few commands when a message like the one below is logged:

 

LC/0/0/CPU0:Dec  8 06:06:40.659 : netio[211]: %PKT_INFRA-PQMON-6-QUEUE_DROP : Taildrop on XIPC queue 5 owned by ipv4_io (jid=181) 

 

So this script is an example of what we can do:

 

  • Save the syslog message.

 

  • Do some regex maching to isolate some part of the syslog message which triggered the message. It extracts the location but we could improve it even further to extract the XIPC queue or the jid.

 

  • Open a CLI to collect some commands (syntax of the commands may reuse parts of the syslog message extracted at the previous step).

 

  • Save the output of the commands to a file (with a timestamps in the filename to avoid overwriting previous files

 

Here are the files:

 

  • punt.tcl: The script to install on the router 

 

  • how_to_install.txt: The install instructions to send to customer

 

When you need to troubleshoot another kind of problem which should be triggered by another syslog message, the punt.tcl script can be modified:

 

- The name of the script can be changed. The install instructions in the "how_to_install.txt" will have to be modified accordingly.

- The "event_register_syslog pattern" can be modified to match the syslog message.

- The "cmd_list" can be modified to contain another set of commands.


https://drive.google.com/file/d/1wBAzHhLOkSZpK_UXL62qU8uJg_Wi_Q2n/view?usp=sharing


https://drive.google.com/file/d/1N4S_RGre-FJ_WmDZfiwOp8tEnNsAObXR/view?usp=sharing

No comments:

Post a Comment