Last active
April 8, 2020 00:14
-
-
Save yujiterada/5c7b72d0d02201482bf5e5506ade2656 to your computer and use it in GitHub Desktop.
Check Advance Security for Meraki Organization
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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