Does Meraki auto schedule a firmware upgrade on you periodically? I received an email from Meraki Technical Support that one of our networks will be upgraded to MS 16.7/CS 16.8. We have not scheduled any updates yet. I know I can reschedule them , but are these "forced" updates? We have change control process and I can work with these emails, just want clarification so I can present the updates to the to the board
... View more
thats next. we have a couple different models. having the team gather that. but the CS 16.8 update fixes the name for individual switches
... View more
!!UPDATE!! I got it to work. I added an if statement to replace empty cells with None def read_csv_to_dict_list(filename):
data = []
with open(filename, 'r') as csvfile:
reader = csv.DictReader(csvfile)
for row in reader:
if row['Port_voiceVlan'] == '':
row['Port_voiceVlan'] = None
data.append(row)
return data
... View more
I figured it out, kinda I had the dict keys swapped with the update switch API requirements response = dashboard.switch.updateDeviceSwitchPort( Serial, portId=row['Port_num'], name=row['Port_name'], type=row['Port_type'], vlan=row['Port_vlan'], ) I removed tags as it wants an array, and voiceVlan as it must be an integer or null
... View more
line 1 of the csv is Port,name,tags,type,vlan,voiceVlan **Edit** I updated the csv. was getting confusing. If I print the dictionary keys.. dict_keys(['Port_num', 'Port_name', 'Port_tag', 'Port_type', 'Port_vlan', 'Port_voiceVlan'])
... View more
Thank you. I get an error line 41, in <module> serial, Port=row["portId"], ~~~^^^^^^^^^^ KeyError: 'portId' ** I changed the serial line. I have the SN as a variable already
... View more
I am trying to import a csv of switch port configs. I am able to print the csv from the below script def read_csv_to_dict_list(filename):
data = []
with open(filename, 'r') as csvfile:
reader = csv.DictReader(csvfile)
for row in reader:
data.append(row)
return data
data = read_csv_to_dict_list("C:\\temp\\Sample Switch.csv")
# Access data
for row in data:
print(f"Port: {row['portId']}, Name: {row['name']}, Tags: {row['tags']}, Type: {row['type']}, Vlan: {row['vlan']}, VoiceVlan: {row['voiceVlan']}")" how do I use this with "updateDeviceSwitchPort"
... View more
Thank you. I should have lead off with, that I am looking at a python API for this task. I'm not sure if I want a bulk import like this. I was looking more for an read csv, and update ports, per single switch kinda API.
... View more
I have a project upcoming to replace our cisco 2960 switches with MS390's. I am looking to import the port configs from the 2960's to the 390's. I cant seem to find a recent import discussion or script to look at. I would like to do a switch at a time, as in target the SN/MAC of the 390 that I want to replicate the config to from a specific 2960 backup.
... View more
Thank you. I had assistance with the below to work with. But I like yours better! Was looking to eliminate the Modular ports and then remove the last two ports from the list (which are the stacked ports) then get the rest of the ports to work with. # Create an empty placeholder for only the intended ports. Exclude things like MOD ports.
target_ports = []
# Loop over the ports and add only the intended ports to the target port list.
for port_status in port_statuses:
# Check if '-MOD-' exists in the portId value string. If it does, skip it.
if '-MOD-' not in port_status['portId']:
# Add only values that do not contain -MOD- to the target ports
target_ports.append(port_status)
# Sanity check, print the number of ports to make sure this is as expected
print('Ports: {}'.format(len(target_ports)))
# Extract the last 2 ports from the list of target ports
last_two = target_ports[-2:]
# Extract all except for the last 2 ports from the list of target ports
primary_ports = target_ports[:-2]
... View more
I appreciate you taking the time to post these. Using real world meraki examples is helping me understand python a little. I wanted to share with anyone who is also new that this works and how I verified it worked. Having time to sit, read, test and digest what I am doing is most of the time, far and few between. I have some time now in between projects so I'm trying to make as much progress as I can, while supporting all the IT services I need to.
... View more
I was able to get this script running in a test network I have set up. https://community.meraki.com/t5/Developers-APIs/Find-Unused-Ports-And-Shut-them-Down/m-p/223886/high... BUT... It disabled the stack ports even if they are connected. Now I don't lose the stack, but in the switch port view I have added the column "enabled" from the status section and the stacked ports are listed as disabled, and I verified on a Production network that they are enabled in this view. I've rebooted the stack but they stay "disabled" To fix this I've had to run the script again and change the last line to "True" How can I exclude the stack ports? They look like ports 25, 26 (MS390-24P)
... View more
I was able to get this to work!! If you check in the change log of the switch it shows the values changed I did have to change the last line I have "dashboard.switch.updateDeviceSwitchPort(device['serial'], port_id,enabled=False)"
... View more
Looks like "getOrganizationDevices" does not handle stacked switches. When I run it only returns the primary switch ports, and not the member switch ports.
... View more
WellyHartanto, question about the cycle ports script... timespan=(31*24*60*60)) Is this 31 days, then 24 hrs in a day, 60 min in an hour, 60 sec in a minute? so if you wanted a different # of days you just need to change the 31?
... View more