Description

This article provides a configuration example of event option to trigger a slax script using the event script feature of the Junos.

Solution

This is useful while applying a workaround or troubleshooting to change a value in the config automatically after the reboot of the device.

Configuration on the CLI

set event-options policy test events PIC
set event-options policy test attributes-match PIC.message matches "FPC PFE resync_done fpc 0"  <-- message to match when FPC comes up after a reboot
set event-options policy test then event-script test.slax
set event-options event-script file test.slax

Copy the script below in the /var/db/script/event folder with name test.slax

Example

labroot@jtac-qfx5120-32c-r2005> start shell
% cd /var/db/scripts/event/
% ls
test.slax
%

More information, refer to Example: Changing the Configuration Using SLAX and XSLT Op Script