Skip to content

Instantly share code, notes, and snippets.

@yujiterada
Last active April 8, 2020 00:14
Show Gist options
  • Select an option

  • Save yujiterada/5c7b72d0d02201482bf5e5506ade2656 to your computer and use it in GitHub Desktop.

Select an option

Save yujiterada/5c7b72d0d02201482bf5e5506ade2656 to your computer and use it in GitHub Desktop.
Check Advance Security for Meraki Organization
import os
import meraki
MERAKI_API_KEY = os.getenv('MERAKI_API_KEY')
def has_adv_sec(network_id):
try:
response = client.malware_settings.getNetworkSecurityMalwareSettings(network['id'])
return True
except Exception as e:
#print(' ' + e)
return False
client = meraki.DashboardAPI(
api_key=MERAKI_API_KEY,
base_url='https://api-mp.meraki.com/api/v0/',
output_log=True,
print_console=False)
organizations = client.organizations.getOrganizations()
for organization in organizations:
print(organization['name'])
networks = []
org_has_adv_sec = False
client_vpn_networks = []
try:
networks = client.networks.getOrganizationNetworks(organization['id'])
except Exception as e:
# print(' ' + e)
org_has_adv_sec = 'Unknown'
for network in networks:
if not org_has_adv_sec:
try:
org_has_adv_sec = has_adv_sec(network['id'])
except Exception as e:
# print(' ' + e)
pass
else:
break
print(' Advanced Sec License: ' + str(org_has_adv_sec))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment