- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
How to monitor the status of a switch port via API
Hi,
I wonder how to monitor the status, especially connectivity of a switch port.
When I put the cursor on the connectivity bar whose color is red, it shows a message saying "Feb 26 xx:xx – Feb 27 xx:xx, 1 Gigabit link failed, speed downshifted".
What is the standard of changing color and how can I get the information of the status of the switch port via API?
p.s. I know how to get configuration of a switch port via the API(GET /devices/{serial}/switchPorts).
- Labels:
-
Dashboard API
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Meaning of the colors:
https://documentation.meraki.com/MS/Monitoring_and_Reporting/Switch_Port_View#Port_Overview
API to get the switch port statuses:
- 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'm using the same API but I get conflicting Traffic reporting between UI and API.
On the UI I have
while on the JSON output I get:
Any idea on what's the most recent timespan to use and why those values are different between UI and API (even it is in Mbps vs Kbps)
https://api.meraki.com/api/v1/devices/{serialnumberofswitch}/switch/ports/statuses?timespan=86400
(I don't know the minimum timespan possible)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This might be a matter of conversion.
1Mb = 1,024 Kb (not 1,000).
1Gb = 1,024 Mb = 1,048,576 Kb.
Therefore 1,051,718,192 Kb = 1,003 Gb.
Does it make sense?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Unless you have a very small environment, I wouldn’t recommend a timespan lower than 300 seconds as this is a device-level API call and you can get rate limited if you’re not careful. I make these every 900 seconds and use SNMP if I have more than 1000 switches or need more frequent updates.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
There are some nice Org wide calls for this now (some in beta), so scaling to thousands of switches on a 5 min polling interval via the dashboard API is totally possible (we do this!)
COO
Highlight - Service Observability Platform
www.highlight.net
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Agreed. We’re very much looking forward to using the two new org-level switch endpoints when they graduate from early access to general availability. They are orders of magnitude more scalable than the current statuses endpoint, so they will provide more flexibility. However, I still have customers with thousands of switches who using my observability platform and run automation scripts for IMACD IT Operations, so we still need to exercise extreme caution to avoid introducing or being affected by rate limiting and to have options when the API is already clogged by some other tool.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes, really we need a way to carve out API resources so we don't impact, or are impacted by other API apps. @Oren please please please!
COO
Highlight - Service Observability Platform
www.highlight.net
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
getOrganizationSwitchPortsStatusesBySwitch is now GA. Our documentation will reflect it on our coming update later this week.
Port statuses of 50 switches in a single API call.
@MartinS, I hear you loud and clear. I don't have news to share on that front yet.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks @Oren. I just tested this and got a 404.
curl -L --request GET \
--url 'https://api.meraki.com/api/v1/organizations/[OrgID]/getOrganizationSwitchPortsStatusesBySwitch?perPa...' \
--header 'Authorization: Bearer [API Key]' \
--header 'Accept: application/json'
{"status":"404","error":"Not Found"}%
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Try api.meraki.com/api/v1/organizations/[organizationId]/switch/ports/statuses/bySwitch.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks @Oren. That worked. However, I had to limit the perPage input parameter to 20.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Great to hear!
What happens for greater values?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I got this when I used 50:
{
"errors":["The perPage parameter must be between 3 and 20"]
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Got it. The new documentation (that's about to be released) states:
The number of entries per page returned. Acceptable range is 3 - 20. Default is 10.
I didn't notice that.
