The Meraki Community
Register or Sign in
cancel
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
Showing results for 
Show  only  | Search instead for 
Did you mean: 
  • About TommyD
TommyD

TommyD

Conversationalist

Member since Jan 5, 2018

‎10-07-2021
Kudos given to
User Count
PhilipDAth
Kind of a big deal PhilipDAth
1
View All

Community Record

7
Posts
0
Kudos
0
Solutions

Badges

1st Birthday
First 5 Posts
Lift-Off View All
Latest Contributions by TommyD
  • Topics TommyD has Participated In
  • Latest Contributions by TommyD

How to find all MXs that do not have a USB modem connected?

by TommyD in Security / SD-WAN
‎10-07-2021 05:40 AM
‎10-07-2021 05:40 AM
Hello everyone,   I have been requested to provide a report from Meraki that would show all Networks that do not have a USB Modem connected to the MX Uplink. Can anyone point me in the right direction of how I could achieve this? I have been testing the API capabilities for get-organization-uplinks-statuses, but I don't see how I can create a report that would show all of the networks in the response that do not have a Cellular Uplink associated to it.   Thank you very much for any help on this one,  Tom ... View more

Re: Using variables in URL help

by TommyD in Developers & APIs
‎01-28-2018 08:04 AM
‎01-28-2018 08:04 AM
You might be on to something, I know that all of the Networks don't belong to VLANS, the first ID that appears in the list when running the URL " https://api.meraki.com/api/v0/organizations/ {{organizationID}} /networks/" in Postman does not belong to a VLAN.  I know all of the Networks that contain the word "STORE" do belong to VLANS.  Do you happen to know how to perform a filter on "name" so it would only return those Networks in the following section?   net_list = requests.get(MERAKI_URL + 'organizations/' + ORG_KEY + '/networks', headers=headers) if net_list.status_code != 200: print('Incorrect Network Query String'); exit(1); else: json_list = json.loads(net_list.text) return json_list   Or before the VLAN def runs?   # Function to grab the VLAN's in the Network, based on Network ID (passed) def get_vlan_info(passed_id): vlan_list = requests.get(MERAKI_URL + 'networks/' + passed_id + '/vlans', headers=headers) if vlan_list.status_code != 200: print('Incorrect VLAN Query String'); exit(1);   Thanks again, I truly truly am very thankful, Tom ... View more

Re: Using variables in URL help

by TommyD in Developers & APIs
‎01-28-2018 07:37 AM
‎01-28-2018 07:37 AM
Hello Philip,   Thanks, I do have VLANing turned on, on our MXs.   Thanks, Tom  ... View more

Re: Using variables in URL help

by TommyD in Developers & APIs
‎01-27-2018 06:51 AM
‎01-27-2018 06:51 AM
That is awesome, thanks for the help, much appreciated.  I am in a glass case of emotion.   That for sure put me on a better track, that is exactly what I was looking for.   I'm using PyCharm now, and of course I still don't know what I'm doing, but slowly learning. : ).  I've defined the variables and it looks like I get passed the get_net_ids step, but the script fails at the get_vlan_info step with the error:  Incorrect VLAN Query string I think it's either not creating the json_list in the get_net_ids def or its not passing the id to the get_vlans_info def.   Below is the actual script I am using.  (minus the defined variables) (Ugh - it pasted ugly, here's a link as well)   https://github.com/portseven/merpy/blob/master/merpy_get_vlans.py       import requests import json # Define some variables we need API_KEY = 'SOMEKEY' MERAKI_URL = 'https://dashboard.meraki.com/api/v0/' ORG_KEY = 'SOMEORG' headers = {'X-Cisco-Meraki-API-Key':API_KEY} # Function to grab the list of the Networks for the Organisation def get_net_id(): net_list = requests.get(MERAKI_URL + 'organizations/' + ORG_KEY + '/networks', headers=headers) if net_list.status_code != 200: print('Incorrect Network Query String'); exit(1); else: json_list = json.loads(net_list.text) return json_list # Function to grab the VLAN's in the Network, based on Network ID (passed) def get_vlan_info(passed_id): vlan_list = requests.get(MERAKI_URL + 'networks/' + passed_id + '/vlans', headers=headers) if vlan_list.status_code != 200: print('Incorrect VLAN Query String'); exit(1); else: json_vlist = json.loads(vlan_list.text) return json_vlist def main(): # Get list of networks and ID's net_data = get_net_id() for i in net_data: net_name = i["name"] net_id = i["id"] # Ignore the MDM Network if net_name == 'MDM': continue else: # Use the ID to get a list of VLAN's per Network vlan_data = get_vlan_info(net_id) for v in vlan_data: # Extract just the VLAN Name, and Subnet Range sub_net = v["subnet"] vlan_name = v["name"] # Print Results in a CSV Friendly Format print(net_name + ', ' + vlan_name + ', ' + sub_net) main()    ... View more

Using variables in URL help

by TommyD in Developers & APIs
‎01-26-2018 12:23 PM
‎01-26-2018 12:23 PM
Hello everyone, My apologies, I am not a Developer, however I have been placed with a task with creating an automatic way to obtain values found thru the Meraki API.   The main goal is to obtain the "Subnet" for every NetworkId that belongs to VLAN 1, then create a .csv file so I can import it into a monitoring tool called DCRUM.   So I thought I would use PostMan to achieve this.  I am able to set the Environmental Variables for the first step. https://api.meraki.com/api/v0/organizations/ {{organizationID}} /networks/   Below is the Test Script I am using, it successfully populates the Environmental Variables (NetworkName, networkNAMEs, NetworkID, and NetworkIDs.   var jsonData = JSON.parse(responseBody); var schema = { "id": { "name" :{ } } }; var networkNAMEs = []; var networkIDs = []; jsonData.forEach(function(network) { var testTitle = network.name + " , " + network.id + " conforms to schema"; tests[testTitle] = tv4.validate(network, schema); networkNAMEs.push(network.name); networkIDs.push(network.id); }); postman.setEnvironmentVariable("NetworkName", networkNAMEs.shift()); postman.setEnvironmentVariable("networkNAMEs", JSON.stringify(networkNAMEs)); postman.setEnvironmentVariable("NetworkId", networkIDs.shift()); postman.setEnvironmentVariable("NetworkIDs", JSON.stringify(networkIDs));   The second Request I need to run the following URL in a loop, each time updating the NetworkId variable within the URL with the next NetworkId in the NetworkIDs EnvironmentVariables.   https://api.meraki.com/api/v0/networks/ {{NetworkId}} /vlans/1   However, my Test Results all fail with the below error: FAIL Status code is 200 | AssertionError: expected response to have status code 200 but got 404   The Test Script I am using is:   var networkIDs = [];   networkIDs = JSON.parse(postman.getEnvironmentVariable("NetworkIDs"));   console.log(networkIDs);   for (var i = 0; i < networkIDs.length; i++) { postman.setEnvironmentVariable("NetworkId", networkIDs[i]); postman.setNextRequest(); pm.test("Status code is 200", function () { pm.response.to.have.status(200); }); }   What I really need to know is, am I going about this the right way?  Should I be using a different tool? If not, the outcome I need is to be able have the Test Results contain the Networkname and Subnet for each iteration and save the results in a .csv, or any file that I can convert later to a .csv.   I hope this is enough details for everyone, please just let me know if I'm just a little too slow to tackle something like this. : )   Thanks for all the help, Tom         ... View more

Re: REST API help

by TommyD in Developers & APIs
‎01-06-2018 01:29 PM
‎01-06-2018 01:29 PM
Hello,   Thank you for your help,  The purpose of trying to generate a json or if possible a CSV export is we are using another product called DCRUM, which we are needing to import all of the locations (Network Names) and their corresponding subnets, but each Network has several subnets associated to them.  We only need the ones filtered on VLAN 1.   I can't find a report that lists the following   Subnet,NetworkName,VLAN 111.222.333.0,MyNetwork,1   I hope this helps, thanks again, Tom ... View more

REST API help

by TommyD in Developers & APIs
‎01-05-2018 12:20 PM
‎01-05-2018 12:20 PM
Hello everyone,   My apologies, I am very new to using APIs and I have reviewed the Dashboard API doc but am still unable to figure out how to get the results I need.   All I need to do is to produce a report that displays the subnet for each of our networks, name of the network, and filtered for only VLAN 1.   Thanks everyone for your help, Tom ... View more
Kudos given to
User Count
PhilipDAth
Kind of a big deal PhilipDAth
1
View All
Powered by Khoros
custom.footer.
  • Community Guidelines
  • Cisco Privacy
  • Khoros Privacy
  • Privacy Settings
  • Terms of Use
© 2023 Meraki