QuestionQ87

VerifiedController-Based Network Automation

An engineer needs to track device availability throughout a Cisco Meraki organization to identify unhealthy networks. They must retrieve device-status records and summarize them by status and model for real-time health reporting. Drag the code snippets into the boxes to build the artifact. Not every option is needed.

Drag & Drop
import meraki
from collections import Counter

API_KEY = "MERAKI_API_KEY"
dashboard = meraki.DashboardAPI(API_KEY, output_log=False, suppress_logging=True)

org_id = "123456"
devices = dashboard..(org_id, perPage=1000, total_pages="all")

by_status = Counter(d.get("", "unknown") for d in devices)
top_models = Counter(d.get("", "unknown") for d in devices).most_common(5)

print("Status counts:", dict(by_status))
print("Top models:", top_models)
Explanation

Cisco Meraki’s Python Dashboard API exposes organization-scoped endpoints through dashboard.organizations; getOrganizationDevicesAvailabilities returns device availability information. The returned device records include status for availability state and model for hardware model, so those fields are the appropriate Counter keys.

Learn more

Community Discussion

No comments yet. Be the first to start the discussion!