05-17-2018 06:16 PM - edited 03-01-2019 06:35 PM
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.
Solved! Go to Solution.
05-17-2018 10:51 PM
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
05-17-2018 10:51 PM
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
05-20-2018 12:13 PM
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
05-23-2023 08:20 PM
"y" character simulates you pressing enter key to confirm you want to reload the interface
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide