API call for device status by network

MarkR3
New here

API call for device status by network

Hello,

We have a large implementation of 7500 access points (devices) across 125 locations (networks)

I previously used the API to call the status of all of our access points and populate a dashboard in our call center. This allowed us to immediately see if an access point went down or if the entire network was offline. The API limits are now limiting us so I need to figure out how to keep the call within 1000 rows.

 

The device status summary would be perfect if I could break this apart by network - does anybody know if that's possible OR if there's a better way to report on the status of offline/alerting access points?

 

https://developer.cisco.com/meraki/api-v1/get-organization-devices-statuses-overview/

7 Replies 7
Amit_pal
Getting noticed

MarkR3
New here

Yes, that is done by our NOC but I'm using the API to create a dashboard for our call center. I can't send alerts for 7500 devices to the entire team.

Ryan_Miles
Meraki Employee
Meraki Employee

You can filter by network Ids in that call https://api.meraki.com/api/v1/organizations/xxxxx/devices/statuses/overview?networkIds[]=N_xxxx

Ryan

If you found this post helpful, please give it Kudos. If my answer solves your problem please click Accept as Solution so others can benefit from it.
David_Jirku
Meraki Employee
Meraki Employee

I believe this is the new endpoint you can leverage https://community.meraki.com/t5/Developers-APIs/Now-GA-Device-Availability-Change-History/m-p/201052

 

This endpoint returns the time-stamped availability change events that occurred for the organization's devices in the requested timespan, and is intended to be a hyper-efficient means of monitoring device availabilities. You can get started by calling:

 

 

GET /organizations/:organizationId/devices/availabilities/changeHistory

 

 

An empty result means there were no availability changes for any device in that organization for that timespan.

 

Default timespan is 1 day; maximum timespan is 14 days. Aside from the standard t0/t1/timespan controls, other filters include:

 

 

productTypes[]
networkIds[]
serials[]
statuses[]

 

sungod
Kind of a big deal

The org-wide call mentioned by @David_Jirku is probably the lightest touch, but you do need to track device state separately as only state changes are returned.

 

The device status call is simpler as it's stateless, but you get more data back, though if you use it like the snippet below, it'll return info only on wireless devices that are offline/alerting/dormant...

 

statuses = await aiomeraki.organizations.getOrganizationDevicesStatuses(ORG_ID, statuses = ["offline", "alerting", "dormant"], productTypes = ["wireless"], perPage=1000, total_pages="all")

 

 

MarkR3
New here

I think this is the right approach for what I'm trying to accomplish but I'm still not getting the right results. It seems to only see a fraction of what I know is true. I'm seeing 2 alerting APs but I know there's more. Offline is empty but I'm looking at offline access points in the console.

 

Is it possible that it's only looking through the first 1000 access points to see which ones are offline/alerting?

sungod
Kind of a big deal

I've always assumed the pagination is on returned results, not pre-filtered data, but if your code correctly handles pagination that wouldn't matter anyway.

 

Not specific to this call, there can be differences between API-Dashboard, reason vary, it can be a bug.

 

If you know that specific devices are offline and not being correctly reported, I suggest open a support case with the details,, if it's a bug it needs fixing, if there's some other reason, it would be good to know.

 

I'd try running the call without any filters, then see how the totals for each status compare to what you see in Dashboard, just in case it's a filtering-related issue.

Get notified when there are additional replies to this discussion.