cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Cycle Port

Here to help

Cycle Port

We are having an issue with a PoE device that only seems to crop up every few days. It appears that the devices have an inherent problem that the vendor needs to fix with a firmware update. In the meantime, the workaround is to go into the switch and click the "cycle port" button. I'll end up writing a python script that will loop through the switches in my organization and cycle to ports that have a tag for the problem devices. Is there a way to cycle a port through the API?

 

I know I could disable and enable the port using: 

meraki.updateswitchport(apikey, serialnum, portnum, name=None, tags=None, enabled=False, 
porttype=None, vlan=None,voicevlan=None, allowedvlans=None, poe=None, isolation=None,
rstp=None, stpguard=None, accesspolicynum=None, suppressprint=False) meraki.updateswitchport(apikey, serialnum, portnum, name=None, tags=None, enabled=True,
porttype=None, vlan=None,voicevlan=None, allowedvlans=None, poe=None, isolation=None,
rstp=None, stpguard=None, accesspolicynum=None, suppressprint=False)

However, this sends alerts of changes to the switch ports whereas the "cycle port" button doesn't send any alerts. I'd like to cut down on the spam if possible as I would end up with alerts from all of our networks every morning.

 

 

7 REPLIES 7
Highlighted
Kind of a big deal

Re: Cycle Port

I've never been able to find an API that has cycle port option. I looked for it because I wanted to use it to reboot access points (which I ended up doing a separate python script/API call for which is the reboot API call).

So as of right now, there isn't an option for API to cycle port. Hopefully in the future they'll provide that.
Nolan Herring | nolanwifi.com
TwitterLinkedIn
Kind of a big deal

Re: Cycle Port

If this is a Meraki Switch (MS) then configure a port schedule instead.

 

https://documentation.meraki.com/MS/Access_Control/Port_Schedules

Here to help

Re: Cycle Port


@PhilipDAth wrote:

If this is a Meraki Switch (MS) then configure a port schedule instead.


I'll take a look at it, but I want it go off and back on immediately. It seems like this method would require the port to be down for 1/2 an hour at a minimum.


Kind of a big deal

Re: Cycle Port

> It seems like this method would require the port to be down for 1/2 an hour at a minimum.

 

Correct.  You can't do it at a horrible time of the day like 2am?

Here to help

Re: Cycle Port


@PhilipDAth wrote:

> It seems like this method would require the port to be down for 1/2 an hour at a minimum.

 

Correct.  You can't do it at a horrible time of the day like 2am?


No--Security cameras. What's happening is if we use the most efficient format, the cameras will lose communication with the server and ends up buffering everything until the server or camera reboots. Our camera guy just does it manually, but he was hoping we could automate. I'll test it out and just deal with the spam.

Here to help

Re: Cycle Port

Since the API endpoint doesn't seem to exist, have you tried adapting your script to:

  • Disable the email alert that is triggered by the port status change
  • Disable the port
  • Enable the port
  • Enable the email alert again

 

Of course you'll need to get the network ID for each switch but that shouldn't be a big problem.

Here to help

Re: Cycle Port


@Raphael_M wrote:

Since the API endpoint doesn't seem to exist, have you tried adapting your script to:

  • Disable the email alert that is triggered by the port status change
  • Disable the port
  • Enable the port
  • Enable the email alert again

 

Of course you'll need to get the network ID for each switch but that shouldn't be a big problem.


That is a clever solution, but the alerts are set for configuration changes, not port status changes, so this wouldn't actually solve this one for me.

Welcome to the Meraki Community!
To start contributing, simply sign in with your Cisco account. If you don't yet have a Cisco account, you can sign up.