Efficient way to monitor switchports

SOLVED
boomi
Getting noticed

Efficient way to monitor switchports

I want to be able to fetch switchport data via the API similar to how I would with SNMP, for the 'usual' metrics: 

  • Speed/Duplex
  • Operational / Administrative Status
  • Throughput
  • Error packets / packet types.

All of this is exposed via the API, but to the best of my knowledge, I have to make three separate calls per switch to retrieve all of this info. This isn't a problem, until the rate limiting kicks in. I do have backoff logic in place, but apparently it's not always cutting it.

 

This is what I'm doing, does anyone know of a way to reduce the calls?

 

 

 // Retrieve interface packet counts for the switch.
query('/api/v0/devices/' + device.serial + '/switchPortStatuses/packets?timespan=' + TIMESPAN)

 // Retrieve interface usage counts for the switch
query('/api/v0/devices/' + device.serial + '/switchPortStatuses?timespan=' + TIMESPAN)

// Retrieve interface statuses for the switch. Cannot use the above call because it blanks out 'status' values when a timespan is applied.
query('/api/v0/devices/' + device.serial + '/switchPortStatuses')

 

 

1 ACCEPTED SOLUTION
PhilipDAth
Kind of a big deal

No way to reduce the API calls sorry.

 

The latest Python SDK does support rate-limiting.

For node.js I use bottleneck to manage it automatically.

View solution in original post

2 REPLIES 2
PhilipDAth
Kind of a big deal

No way to reduce the API calls sorry.

 

The latest Python SDK does support rate-limiting.

For node.js I use bottleneck to manage it automatically.

View solution in original post

Gotcha, thanks for confirming Philip.
Get notified when there are additional replies to this discussion.
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.