cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3322
Views
0
Helpful
4
Replies

Run an EEM applet on the basis of Reload Reason

kiqbal0941
Level 1
Level 1

I want to run an EEM after router reloads only if the reload was initiated by an EEM applet. I want this EEM to trigger after 10 mins of reload.

1 Accepted Solution

Accepted Solutions

Then you could have an applet that runs a reload and configures this other applet if the reload reason is right.  You can use the example below as a template:

 

event manager environment q "

!

event manager applet reload

 event timer cron cron-entry "@reboot"

 action 001 cli command "enable"

 action 002 cli command "show ver | inc Last reload reason: Embedded Event Manager action"

 action 003 regexp "Embedded Event Manager action" $_cli_result

 action 004 if $_regexp_result eq 1

 action 005  cli command "config t"

 action 006 cli command "event manager applet do-stuff"

 action 007 cli command "event timer countdown time 600"

 action 008 cli command "action 1.0 cli command enable"

 action 009 cli command "action 2.0 cli command $q config t$q"

 ...

View solution in original post

4 Replies 4

Joe Clarke
Cisco Employee
Cisco Employee

I don't recall, but does the reload reason (in show ver) actually state reloaded by EEM (or similar) if an EEM policy reloads the device?

Yes it does as shown below...

 

Last reload reason: Embedded Event Manager action

Then you could have an applet that runs a reload and configures this other applet if the reload reason is right.  You can use the example below as a template:

 

event manager environment q "

!

event manager applet reload

 event timer cron cron-entry "@reboot"

 action 001 cli command "enable"

 action 002 cli command "show ver | inc Last reload reason: Embedded Event Manager action"

 action 003 regexp "Embedded Event Manager action" $_cli_result

 action 004 if $_regexp_result eq 1

 action 005  cli command "config t"

 action 006 cli command "event manager applet do-stuff"

 action 007 cli command "event timer countdown time 600"

 action 008 cli command "action 1.0 cli command enable"

 action 009 cli command "action 2.0 cli command $q config t$q"

 ...

Thank You Joseph, it worked.

Getting Started

Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community:

Innovations in Cisco Full Stack Observability - A new webinar from Cisco