10-06-2015 06:42 AM - edited 03-08-2019 02:05 AM
Hi,
I'm just learning how to use EEM on my switch and created an applet that shuts the port down every day after production hours, and brings it back up in the morning. The applet is working well but I want to create a second applet that shuts the port down on Friday evening and doesn't bring it back up until Monday morning. Is there a way to do this? If so, will a second time-based applet on the same port conflict with the first applet I created to bring the port down after production hours every day, and back up every morning?
This is the configuration for the applet I already created:
event manager applet noshut
event timer cron name noshut cron-entry "30 7 * * *"
action 1 cli command "configure terminal"
action 2 cli command "interface gi1/0/12"
action 3 cli command "no shutdown"
event manager applet shut
event timer cron name shut cron-entry "30 16 * * *"
action 1 cli command "configure terminal"
action 2 cli command "interface gi1/0/12"
action 3 cli command "shutdown"
I'm assuming that the "* * *" in the commands are instructing EEM to execute the command every day. I can run a "sh clock" command and it will specify a day by name (i.e., Tue, Sat, etc). So can I configure an applet that instructs EEM to keep the port down every Sat and Sun?
Solved! Go to Solution.
10-06-2015 10:37 PM
Hello
Why not reuse the same applet just with a different cron entry? There should be no conflict in having multiple applets running with similar objective. For example:
run on Friday at 5:00pm
"0 17 * * 5"
run on Monday at 7:00am
"0 7 * * 1"
Would that work for you?
Another option, if port gi1/0/12 is an L3 port, would be to configure a time-based access-list which would filter out all traffic received in a certain time period but without shutting the port down. Have a look here: http://www.cisco.com/c/en/us/support/docs/security/ios-firewall/23602-confaccesslists.html#timebasedtimerange
Best regards,
Martin
10-06-2015 10:37 PM
Hello
Why not reuse the same applet just with a different cron entry? There should be no conflict in having multiple applets running with similar objective. For example:
run on Friday at 5:00pm
"0 17 * * 5"
run on Monday at 7:00am
"0 7 * * 1"
Would that work for you?
Another option, if port gi1/0/12 is an L3 port, would be to configure a time-based access-list which would filter out all traffic received in a certain time period but without shutting the port down. Have a look here: http://www.cisco.com/c/en/us/support/docs/security/ios-firewall/23602-confaccesslists.html#timebasedtimerange
Best regards,
Martin
10-08-2015 05:46 AM
Thanks! I created a second cron entry. I'll wait and see if it works this weekend.
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