# Cisco IOS Embedded Event Manager (EEM)

**URL:** https://forum.networklessons.com/t/cisco-ios-embedded-event-manager-eem/1106
**Category:** Lessons Discussion
**Created:** [December 26, 2016, 10:56pm UTC](https://forum.networklessons.com/t/cisco-ios-embedded-event-manager-eem/1106 "2016-12-26T22:56:08Z")
**Posts on this page:** 1
**Showing post:** 21

<div class="post-metadata">

### Author: ![lagapidis](https://cdn-forum.networklessons.com/user_avatar/forum.networklessons.com/lagapidis/32/4949_2.png) [@lagapidis](https://forum.networklessons.com/u/lagapidis)
#### Post date: [February 16, 2017, 7:45am UTC](https://forum.networklessons.com/t/cisco-ios-embedded-event-manager-eem/1106/21 "2017-02-16T07:45:52Z")

</div>

Hello Alfredo

Yes, it is possible to shutdown and enable specific ports based on time. The following example may shed some light on this:

When using EEM, you must create two applet timer policies, one to “`shutdown`” and the other to “`no shutdown`”. In the following example, the port will be shutdown every day at midnight, and brought back up every day at 8 am.

```
event manager applet shutdown_port
event timer cron cron-entry "0 0 * * *"
action 1.0 cli command "enable"
action 2.0 cli command "config t"
action 3.0 cli command "interface FastEthernet1/0/1"
action 4.0 cli command "shut"
action 5.0 cli command "end"
action 6.0 syslog msg "Interface FastEthernet1/0/1 has been shutdown"

event manager applet noshut_port
event timer cron cron-entry "0 8 * * *"
action 1.0 cli command "enable"
action 2.0 cli command "config t"
action 3.0 cli command "interface FastEthernet1/0/1"
action 4.0 cli command "no shut"
action 5.0 cli command "end"
action 6.0 syslog msg "Interface FastEthernet1/0/1 has been restored"

```

Keep in mind that this will work only if you are running IOS 12.2(40)SE or higher. Also it’s a good idea to have NTP configured on the switch when implementing time based scripts.

I hope this has been helpful!

Laz

---

_[View the full topic](https://forum.networklessons.com/t/cisco-ios-embedded-event-manager-eem/1106)._
