- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Find Unused Ports And Shut them Down
Hi All,
Thank you in advance for your help. Is there any API to list the org or network wired ports and filter unused ports, then shut them down?
Solved! Go to solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Unfortunately, there is no single API call, which will do all of that. You'll have to write a script, that will implement several different API calls, that will filter ports that are unused, and disable them.
Like what you see? - Give a Kudo ## Did it answer your question? - Mark it as a Solution 🙂
All code examples are provided as is. Responsibility for Code execution lies solely your own.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@AhmedJawad It would help if you defined what is "unused ports" for you.
Try to get the information on port usage (https://developer.cisco.com/meraki/api/get-device-switch-ports-statuses) for a defined timespan (max 31 days) then disable the ports which match your criteria (https://developer.cisco.com/meraki/api/update-device-switch-port)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
If I'm using python SDK below , I just like to use SDK.
how do i pass the time 30 days for example to the SDK below , see the Status line in the end there Serial, how do I pass time?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I was able to get this to work!!
If you check in the change log of the switch it shows the values changed
I did have to change the last line
I have "dashboard.switch.updateDeviceSwitchPort(device['serial'], port_id,enabled=False)"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, you are correct.
I was copy-pasting a fragment of my own script where 'serial' is a variable somewhere on my code to do other things.
I just tried to explain the logic and which API calls should be made.
In the end, your approach may vary to suit your own needs.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I appreciate you taking the time to post these. Using real world meraki examples is helping me understand python a little.
I wanted to share with anyone who is also new that this works and how I verified it worked.
Having time to sit, read, test and digest what I am doing is most of the time, far and few between. I have some time now in between projects so I'm trying to make as much progress as I can, while supporting all the IT services I need to.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
What happens when a client device is shutdown overnight and it's powered on the next morning? Wouldn't this create more work than good?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When auditing I look for ports that have been down for a period of time I.e longer than a month. These are then shut and placed into a non routable VLAN
https://www.linkedin.com/in/darrenoconnor/
I'm not an employee of Cisco/Meraki. My posts are based on Meraki best practice and what has worked for me in the field.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I guess we can check when the last time the port had a client on it was.
