Hi,
can anyone help me with how i can find the total down time (or time spent in a status) for an AP over a time period?
dashboard.organizations.getOrganizationDevicesStatuses(org_id, productTypes=['wireless'], total_pages='all')
Will give the current status, but i want to be able to see how long and how many times an AP has gone of line in the last week? If i am running the report once per week I not only want to know the current AP status but the history for the last time period.
The code below could be nicer but it was a simple way to pull back the numbers of AP in each start for each network. but as i say it's only when the Script runs it doesn't provide the history I need.
Is there any way i can find per device the status changes and time stamps or other way where i could work this out?
Thank you
networks = dashboard.organizations.getOrganizationNetworks(org_id)
ndevices = dashboard.organizations.getOrganizationDevicesStatuses(org_id, productTypes=['wireless'], total_pages='all')
for net in networks:
numon = len(list({v['name']: v for v in ndevices if (v["status"] == "online") & (v["networkId"] == net["id"]) }.values()))
numalert = len(list({v['name']: v for v in ndevices if (v["status"] == "alerting") & (v["networkId"] == net["id"]) }.values()))
numdormant = len(list({v['name']: v for v in ndevices if (v["status"] == "dormant") & (v["networkId"] == net["id"])}.values()))
numoff = len(list({v['name']: v for v in ndevices if (v["status"] == "offline") & (v["networkId"] == net["id"])}.values()))