cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
2779
Views
0
Helpful
5
Replies

Script to disable PoE?

devils_advocate
Level 7
Level 7

Hello

Scripting is really not my thing but I need a simple script which will effectively sit in the routers flash and do the following:

conf t

Interface range gix/0/x - x

no power inline

Im sure it fairly simple but looking at EEM and TcL makes me think the script is going to need to be pages long to acomplish this little task.

Cheers

1 Accepted Solution

Accepted Solutions

Karthick Murugan
Cisco Employee
Cisco Employee

Hello,

From the post, I could understand when we need to execute those commands but dont know when to understand. Below EEM will configure the interfaces during the bootup.

event manager applet DISABLE_POWER_INLINE

event timer countdown time 1

action 1.0 cli command "enable"

action 2.0 cli command "conf t"

action 3.0 cli command "interface range Gi1/0/1-48"

action 4.0 cli command "no power inline"

action 6.0 cli command "end"

action 7.0 syslog msg "******** POWER INLINE DISABLED ********"

Thanks & Regards,
Karthick Murugan
CCIE#39285

Thanks & Regards, Karthick Murugan CCIE#39285

View solution in original post

5 Replies 5

Karthick Murugan
Cisco Employee
Cisco Employee

Hello,

From the post, I could understand when we need to execute those commands but dont know when to understand. Below EEM will configure the interfaces during the bootup.

event manager applet DISABLE_POWER_INLINE

event timer countdown time 1

action 1.0 cli command "enable"

action 2.0 cli command "conf t"

action 3.0 cli command "interface range Gi1/0/1-48"

action 4.0 cli command "no power inline"

action 6.0 cli command "end"

action 7.0 syslog msg "******** POWER INLINE DISABLED ********"

Thanks & Regards,
Karthick Murugan
CCIE#39285

Thanks & Regards, Karthick Murugan CCIE#39285

Thanks, that works perfectly.

I used the line 'event none' as I wanted to call the event manually when I needed it

I am really glad that the script serverd the purpose.Please rate the post if it really helped!

Thanks & Regards,
Karthick Murugan
CCIE#39285

Thanks & Regards, Karthick Murugan CCIE#39285

I used the line 'event none' as I wanted to call the event manually when I needed it

You want to disable PoE manually?   Then you can use switchport macro (not AUTO switchport macro).

Hi Leo

Currently we want to call the command manually but once I have had a little read up on EEM or TCL, we will likely want the script to be called by an event being triggered. Ideally they want a TFTP server to copy a file in to the flash, the script checks every 5 minutes for the existance of the file and then executes the script. Programming and scripting is not my forte and im not even sure its possible.

Cheers

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: