cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2890
Views
3
Helpful
30
Replies

EEM Script to shutdown multiple ports

swapsakker
Level 1
Level 1

Im trying to make a script to find connected ports in vlan 1 and reset them. It should run when in IP SLA is trickert.

But can't get it to work and im not quiet the programmer.

Here what I have:

event manager applet SHUTDOWN
event timer countdown time 10
action 101 cli command "enable"
action 102 wait 10
action 103 syslog msg "-- Checking for VLAN 1 Ports --"
action 104 cli command "show interfaces status vlan 1 | exclude notconnect|trunk"
action 105 set ports $_cli_result
action 106 syslog msg "-- Shutting Down VLAN 1 Ports --"
action 110 foreach port "$ports" "\n"
action 111 cli command "enable"
action 112 cli command "config t"
action 113 cli command "interface $port"
action 114 cli command "shutdown"
action 115 cli command "end"
action 121 cli command "enable"
action 122 cli command "config t"
action 123 cli command "interface $port"
action 124 cli command "no shutdown"
action 125 cli command "end"
action 126 end

30 Replies 30

to ping from our router, the VRF is needed.
Doh, action 040 cli command "ping vrf 3 $ip"

Why did'nt i see that