12-19-2022 12:56 AM - edited 12-21-2022 06:52 AM
Hi,
I've made a EEM applet for reloading a Cisco router after certain part of message appears in syslog.
No. Class Type Event Type Trap Time Registered Name
1 applet user syslog Off Mon Dec 19 07:21:21 2022 RELOAD
pattern {Text ABC123}
maxrun 20.000
action 1.0 cli command "enable"
action 2.0 cli command "reload"
1.) Why is the text in pattern shown with {} instead with " as I typed?
2.) Trap says it's "off".
3.) In the output below the applet process status is abort so my router never reloads. What I'm missing in the configuration?
Router2#sh event manager history events
No. Job Id Proc Status Time of Event Event Type Name
1 41 Actv abort Mon Dec19 07:24:27 2022 syslog applet: RELOAD
2 42 Actv abort Mon Dec19 07:25:40 2022 syslog applet: RELOAD
3 43 Actv abort Mon Dec19 07:26:52 2022 syslog applet: RELOAD
4 44 Actv abort Mon Dec19 07:28:05 2022 syslog applet: RELOAD
5 45 Actv abort Mon Dec19 07:29:17 2022 syslog applet: RELOAD
6 46 Actv abort Mon Dec19 07:30:30 2022 syslog applet: RELOAD
7 47 Actv abort Mon Dec19 07:31:43 2022 syslog applet: RELOAD
8 48 Actv abort Mon Dec19 07:32:55 2022 syslog applet: RELOAD
9 49 Actv abort Mon Dec19 07:34:08 2022 syslog applet: RELOAD
10 50 Actv abort Mon Dec19 07:35:20 2022 syslog applet: RELOAD
EDIT:
This works:
event syslog pattern ".*Unknown modem on SKU type C881G-4G-GA-K9.*"
trigger delay 2000
action 1 cli command "ena"
action 2 cli command "reload" pattern "confirm"
action 3 cli command "y"
12-19-2022 02:18 AM - edited 12-19-2022 03:25 AM
what is the device model and IOS code running, can you post EEM Script :
event manager applet reload-device
maxrun 20.000
event syslog pattern "my message"
action 1.0 cli command "enable"
action 2.0 cli command "reload"
12-19-2022 02:51 AM - edited 12-19-2022 02:52 AM
can I see your config I will run lab test it
12-19-2022 02:56 AM
event manager applet SKU_RELOAD
event syslog pattern "Unknown modem on SKU type C881G-4G-GA-K9"
action 1.0 cli command "enable"
action 2.0 cli command "reload"
Syslog generates this messages:
Dec 19 07:04:14.346: %CISCO800-2-MODEM_UP: Cellular0 modem is now UP
Dec 19 07:04:34.361: %CELLWAN-4-MODEM_COMM_FAIL: Communication between Modem and IOS failed: link recovery resets modem
Dec 19 07:05:05.956: %PLATFORM-4-CELLULAR_MODEM_SKU_MISMATCH: Mismatch detected between installed modem Unknown modem on SKU type C881G-4G-GA-K9. Expected modem for this SKU is MC7304
12-19-2022 03:05 AM
Hello,
post the output of:
debug event manager action cli
while you run the script.
12-19-2022 03:30 AM
that should work as expected
event manager run SKU_RELOAD - what is the outcome.
12-19-2022 03:59 AM
Router#event manager run SKU_RELOAD
EEM policy SKU_RELOAD not registered with event none Event Detector
12-19-2022 08:11 AM
Hello,
start the script by adding:
Router#send log Unknown modem on SKU type C881G-4G-GA-K9
This will put the matched syslog pattern in the log and trigger the EEM. Post the output of 'debug event manager action cli' then...
12-19-2022 02:52 AM
It's C881G-4G-GA-K9 and the IOS is Version 15.5(3)M4a.
12-19-2022 04:24 AM
Friend I do LAB, and I success do reload
BUT BUT BUT this lab and I did not finish it
event manager applet SKU_RELOAD
event syslog pattern " . * Unknown modem on SKU type C881G-4G-GA-K9 . * " <<- this meaning dont care about timestamp and other words appear in syslog only within ".* ---.*" is important
action 1.0 cli reload <<- you can direct add reload under action
WHAT I concern here ?
with normal reload the R ask to save config if you reload without save the config then it will be lost.
so I need time to finish lab first we must save the config then do reload.
Thanks
12-19-2022 04:34 AM
Thanks for the quick update! I think the problem might be with the syslog pattern since I didn't put .* at the beginning and at the end to ignore rest of the text, meaning that my script will work if only if there is a exact syslog mesagge "Unknown modem on SKU type C881G-4G-GA-K9" which in my case it's not.
12-19-2022 04:37 AM - edited 12-19-2022 04:49 AM
friend again you need to save the config or it will LOST every time even action done.
good luck.
12-21-2022 06:50 AM
This is the final configuration that finally works:
event syslog pattern ".*Unknown modem on SKU type C881G-4G-GA-K9.*"
trigger delay 2000
action 1 cli command "ena"
action 2 cli command "reload" pattern "confirm"
action 3 cli command "y"
12-21-2022 06:52 AM - edited 12-21-2022 06:53 AM
action 1 cli command "ena"
action 2 cli command "reload" pattern "confirm"
action 3 cli command "y"
instead of above
action 1 cli reload <<- that only if your EEM ver support it
and I glad the issue is solved.
good luck friend
12-21-2022 07:03 AM
Thanks for the help!
🙋
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