cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3296
Views
10
Helpful
1
Comments
Santosh Sharma
Cisco Employee
Cisco Employee

EEM script to save logs in a file every 30 mins

Problem:

The router is having an issue where we are unable to login to the router using console or mgmt ports. Other components of router is working fine. RSP reload is the only way we can get access to the router.

Since the access to router is disabled we cannot login to the router in order to collect the logs to debug this issue further.

Solution:

We can use EEM script inorder to collect the logs and save it into a file in harddisk. This EEM script will run every 30 mins and dump the logs into the file. The cron entry can be changed incase we want to run it once every day or some other period.

Logs that the script collects:

show proc devc-vty
show proc devc-conaux
show log
sh processes cpu
Show users
Show line

Router's config:

event manager environment _cron_entry 30,0 * * * 0-6    <<<<< runs script every 30 mins

event manager directory user policy harddisk:/scripts/

event manager policy eem_run_30_min.tcl username event_manager_user

persist-time 3600

username event_manager_user

group root-system

group cisco-support

!

aaa authorization commands eem-method none

aaa authorization eventmanager default local

vty-pool eem 100 105 line-template eem-template

  line template eem-template

authorization commands eem-method

 

More Scripts: EEM Script Repository

Comments
sqamar
Cisco Employee
Cisco Employee

Nice and simple document 

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