cancel
Showing results for 
Search instead for 
Did you mean: 

Schedule a script

Schedule a script

EtherNation_Use
Contributor II
Create Date: Nov 26 2012 9:33PM

Is there a way I can schedule a script to disable some ports in the night and re-enable them again. I want to reboot a POE device every night.

di inline-power port X
en inline-power port X

This should do it but I am trying to figure out if we can schedule the scripts without using Ridgeline? (from Arpit_Bhatt)
7 REPLIES 7

chris88
New Contributor

For this use case, you don’t necessarily need Ridgeline. You can automate it using a simple script with a scheduler. For example, use a shell or Python script to SSH into the switch, run disable inline-power port X at night, and then enable inline-power port X in the morning. Then schedule it with cron (Linux) or Task Scheduler (Windows).

Some switches also support built-in scheduling features or event-based automation, so it’s worth checking your firmware capabilities as well.
In setups where you’re managing multiple configurations (kind of like handling different options in a sonic menu), keeping scripts modular and scheduled externally usually gives more flexibility and control.

EtherNation_Use
Contributor II
Create Date: Dec 6 2012 3:39AM

Hey Prusso,

Looks like i will have to go for UPM profiles coz Ridgeline did not work v well with scheduling. It does not reboot the devices as expected. Shceduling part of the code for script tasks seems to not work.

Thanks for your help.

Arpit (from Arpit_Bhatt)

EtherNation_Use
Contributor II
Create Date: Dec 4 2012 11:41PM

Hey Arbhatt

if you have 12.5 or later ELRP can do that for you. If not then yes scripting will help you do disable the port. I would recommend the new code first as it adds some nice capabilities with a duration versus a permanent disable and the ability to not block uplink or EAPS ports.

good luck (from Paul_Russo)

EtherNation_Use
Contributor II
Create Date: Nov 29 2012 12:32AM

That's a really good explanation. Thank you so much. I am into static scripting but haven't tried the UPM profiles yet. Now i understand the stuff

We have some switches that are still running 12.3.3.6. So I think I can use ELRP to detect loops and then use the event in the log to disable port. Thanks for the information and help.

(from Arpit_Bhatt)
GTM-P2G8KFN