cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1206
Views
0
Helpful
3
Replies
Jeff Van Houten
Contributor

EEM script to read from a file

is it possible to have EEM read from a file on an scp server, then load each line of that file into an acl?  Basically I want eem to update an acl periodically.  I know I can use eem to remove the acl from the interface and add the static parts of the acl back, then add the acl back to the interface.  What I need is a loop to read the remote file and add those addresses to the acl.

3 REPLIES 3
Philip D'Ath
Advisor

I don't know about reading the file, but there are two ways to run something periodically.

To run something every 1800s you could use:

event manager applet task
event timer watchdog time 1800
action 1.0 cli command "enable"
...

Or use the cron scheduler.  To run a task every hour on the hour:

event manager applet task
event timer cron cron-entry "0 * * * *" maxrun 9999999
action 1.0 cli command "enable"
...

Yes, thanks.  I'm familiar with the scheduling commands.

Joe Clarke
Hall of Fame Cisco Employee

An EEM policy can open an SCP URL if the device supports it and read the contents.  It works like reading any other file, only you have to deal with permissions.  Alternatively, you can use the CLI to copy the file to the local flash, then have EEM open the local file, read the contents, and then delete the file when done.

Content for Community-Ad