cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2795
Views
0
Helpful
3
Replies

Reloading Subslot with EEM

nonamer15
Level 1
Level 1

I'm trying to reload one of my HunGig line cards with the EEM script below:

event manager applet reload_0/0/0
 event syslog pattern "SIP0/0: Interface HundredGigE0/0/0, changed state to down"
 action 2.0 cli command "enable"
 action 3.0 cli command "hw-module subslot 0/0 reload" pattern "confirm"
 action 4.0 syslog msg "Reloading subslot 0/0 via EEM"

 

Looking at the debug messages, everything is working as I would expect and I see no errors thrown. For whatever reason, the card is never reloaded.

May 18 01:07:15.630: %HA_EM-6-LOG: reload_0/0/0 : DEBUG(cli_lib) : : CTL : cli_open called.
May 18 01:07:15.630: %HA_EM-6-LOG: reload_0/0/0 : DEBUG(cli_lib) : : OUT : Router>
May 18 01:07:15.630: %HA_EM-6-LOG: reload_0/0/0 : DEBUG(cli_lib) : : IN  : Router>enable
May 18 01:07:15.641: %HA_EM-6-LOG: reload_0/0/0 : DEBUG(cli_lib) : : OUT : Router#
May 18 01:07:15.642: %HA_EM-6-LOG: reload_0/0/0 : DEBUG(cli_lib) : : IN  : Router#hw-module subslot 0/0 reload
May 18 01:07:15.752: %HA_EM-6-LOG: reload_0/0/0 : DEBUG(cli_lib) : : OUT : Proceed with reload of module? [confirm]
May 18 01:07:15.752: %HA_EM-6-LOG: reload_0/0/0: Reloading subslot 0/0 via EEM
May 18 01:07:15.752: %HA_EM-6-LOG: reload_0/0/0 : DEBUG(cli_lib) : : CTL : cli_close called.

 

I've got an ASR1009-X running IOS XE 16.8.1. Any help is appreciated. Thanks.

 

1 Accepted Solution

Accepted Solutions

Rolf Fischer
Level 9
Level 9

Could you try to add a line to confirm the reload, e.g.

event manager applet reload_0/0/0
 event syslog pattern "SIP0/0: Interface HundredGigE0/0/0, changed state to down"
 action 2.0 cli command "enable"
 action 3.0 cli command "hw-module subslot 0/0 reload" pattern "confirm"
 action 4.0 cli command "y"
 action 5.0 syslog msg "Reloading subslot 0/0 via EEM"

 

If you're using AAA command authorization, you'll also need to add "event manager session cli username <Username>" in global configuration mode.

 

HTH

Rolf

View solution in original post

3 Replies 3

Rolf Fischer
Level 9
Level 9

Could you try to add a line to confirm the reload, e.g.

event manager applet reload_0/0/0
 event syslog pattern "SIP0/0: Interface HundredGigE0/0/0, changed state to down"
 action 2.0 cli command "enable"
 action 3.0 cli command "hw-module subslot 0/0 reload" pattern "confirm"
 action 4.0 cli command "y"
 action 5.0 syslog msg "Reloading subslot 0/0 via EEM"

 

If you're using AAA command authorization, you'll also need to add "event manager session cli username <Username>" in global configuration mode.

 

HTH

Rolf

Thanks for the help. Your solution worked. I don't quite understand why I would need to send the "y" character. I tried sending "" to simulate the enter key as that's what you have to do via the CLI, but that didn't work. I thought simply doing "pattern confirm" would take care of this, but it didn't.

 

Additionally, I ended up changing the syslog pattern to add a ratelimit of 30 seconds. This prevented the EEM script from running in an infinite loop.

event syslog pattern "SIP0/0: Interface HundredGigE0/0/0, changed state to down" ratelimit 30

"y" character simulates you pressing enter key to confirm you want to reload the interface