05-29-2018 09:46 AM - edited 03-08-2019 03:10 PM
Folks,
Can someone share with me a sample EEM script that stores all the syslog messages to the flash of the router.
Solved! Go to Solution.
05-29-2018 11:56 AM
Hello,
you don't need an EEM script to accomplish this. Just configure the below (the exact syntax depends on the flash device(s) you have, size also depends on how big your logs are):
Router#conf t
Router(config)#logging buffered 16384 7
Router(config)#logging persistent url flash0:/syslog size 16384 filesize 16384
If you need to have this in an EEM script, the below sample would execute the script every day at midnight:
event manager applet SYSLOG_TO_FLASH
event timer cron cron-entry "0 0 * * *" maxrun 9999999
action 1.0 cli command "enable"
action 2.0 cli command "conf t"
action 3.0 cli command "logging buffered 16384 7"
action 4.0 cli command "logging persistent url flash0:/syslog size 16384 filesize 16384"
action 5.0 cli command "end"
05-29-2018 11:56 AM
Hello,
you don't need an EEM script to accomplish this. Just configure the below (the exact syntax depends on the flash device(s) you have, size also depends on how big your logs are):
Router#conf t
Router(config)#logging buffered 16384 7
Router(config)#logging persistent url flash0:/syslog size 16384 filesize 16384
If you need to have this in an EEM script, the below sample would execute the script every day at midnight:
event manager applet SYSLOG_TO_FLASH
event timer cron cron-entry "0 0 * * *" maxrun 9999999
action 1.0 cli command "enable"
action 2.0 cli command "conf t"
action 3.0 cli command "logging buffered 16384 7"
action 4.0 cli command "logging persistent url flash0:/syslog size 16384 filesize 16384"
action 5.0 cli command "end"
05-31-2018 06:10 AM
Can I log locally to the switch in it's buffer and send messages to the syslog server at the same time?
05-31-2018 06:57 AM
Yes. Actually the sample script I posted does both at the same time...
05-31-2018 10:19 AM
Where do i specify the ip address of the syslog host?
05-31-2018 11:20 AM
Hello
in global configuration mode:
Router(config)#logging host ip-address
05-31-2018 02:14 PM
I am still not clear how this script will send syslog messages to a syslog server and also store them in the flash of a router/switch.
From your eem scrpt i can gather that you are scripting a router/switch to enable logging persistent and store the logs to the switch flash. where is the part in your script that says send the messages to a syslog server as well. please assist.
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