Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

migrate_cat3k.py question #44

Open
Lanlord7 opened this issue Mar 14, 2023 · 7 comments
Open

migrate_cat3k.py question #44

Lanlord7 opened this issue Mar 14, 2023 · 7 comments

Comments

@Lanlord7
Copy link

Is there a forum for this script? I'd love to review some tips and tricks to get it to work. It seems to kick off but I only see a connection in the change log for new networks and not for this existing one.

C:\data\OneDrive - DYOPATHCORP\Mailing List\Cisco Notes\Meraki Notes\Scripting>C:\Users"Jeff G"\AppData\Local\Programs\Python\Python310\python migrate_cat3k.py -k -o "Transport Service" -i migrate_cat3k_JTG2.txt
Reading init config file...
Fetching dashboard organization...
Reading configuration from source devices...
Parsing source configration...
Creating networks...
Claiming devices...
Configuring devices...
Committing action batch:
[{'resource': '/devices/Q2NW-784P-XXXX/switchPorts/36', 'operation': 'update', 'body': {'vlan': '19'}}, {'resource': '/devices/Q2NW-784P-XXXX/switchPorts/37', 'operation': 'update', 'body': {'vlan': '23'}}, {'resource': '/devices/Q2NW-784P-XXXX/switchPorts/38', 'operation': 'update', 'body': {'type': 'trunk', 'tags': ''}}, {'resource': '/devices/Q2NW-784P-HVQN/switchPorts/39', 'operation': 'update', 'body': {'vlan': '23'}}, {'resource': '/devices/Q2NW-784P-XXXX/switchPorts/40', 'operation': 'update', 'body': {'type': 'access', 'vlan': '19'}}]
Waiting for action batches to complete...

End of script.

@mpapazog
Copy link
Contributor

There is no official support forum for scripts in this repository, but you can always try the Meraki Community API section, if you want input from people who have run them: https://community.meraki.com/t5/Developers-APIs/bd-p/api

If you suspect that you might be hitting a bug, then a GitHub issue, like the one you created, is the correct way to get our attention.

Could you elaborate a bit more on the symptom you are experiencing? What do you refer to as new networks vs an existing one?

@Lanlord7
Copy link
Author

Lanlord7 commented Mar 15, 2023 via email

@mpapazog
Copy link
Contributor

  1. Do you see configuration changes being applied though? If you see config being applied, but no entries in the Change log, then that would be an issue in the Change log itself, and not something that can be fixed in this piece of code. If that is the case, I would recommend opening a case with Meraki support. If you are not seeing config being applied, even though it should, let me know, as it might be caused by an issue in the script.

  2. It is a very long time since I wrote this script, but if I decipher my code correctly, it should work for existing networks as well. It attempts to add networks if they do not exist, and after that attempts to apply config to both newly created and existing networks. That is the intention at least. If your results are different, let me know.

@Lanlord7
Copy link
Author

Lanlord7 commented Mar 16, 2023 via email

@mpapazog
Copy link
Contributor

Sounds like the script has a bug or could use an additional feature. I am working on something else right now, so cannot take a look at possible modifications immediately.

If someone in the community would like to take a stab at improving this script, let me know. Otherwise, I will look into this more closely once I am able to.

@Lanlord7
Copy link
Author

Lanlord7 commented Mar 16, 2023 via email

@Lanlord7
Copy link
Author

Lanlord7 commented Jun 5, 2023

As an update, I learned that v0 has been sunsetted and is to be replaced with v1.

https://developer.cisco.com/meraki/api/#!introduction/meraki-dashboard-api-v0

Having done that, I'm now getting some errors.

C:\data\OneDrive - DYOPATHCORP\Mailing List\Cisco Notes\Meraki Notes\Scripting>C:\Users"Jeff G"\AppData\Local\Programs\Python\Python311\python.exe migrate_cat3k.py -k -o -i migrate_cat3k_JTG3.txt
Reading init config file...
Fetching dashboard organization...
Reading configuration from source devices...
ERROR 09: Could not read source config file: IOS-3750X-config3.cfg
ERROR 18: Unable to read configuration from source "IOS-3750X-config3.cfg"
Parsing source configration...
Creating networks...
Traceback (most recent call last):
File "C:\data\OneDrive - DYOPATHCORP\Mailing List\Cisco Notes\Meraki Notes\Scripting\migrate_cat3k.py", line 922, in
main(sys.argv[1:])
File "C:\data\OneDrive - DYOPATHCORP\Mailing List\Cisco Notes\Meraki Notes\Scripting\migrate_cat3k.py", line 752, in main
if not existing['type'] in ['switch', 'combined']:
~~~~~~~~^^^^^^^^
KeyError: 'type'

Here is the contents of the init config file.

interface GigabitEthernet1/0/9
description Reserved for CVCUPS01 - Eth 0
switchport access vlan 102
switchport mode access
spanning-tree portfast edge

Is there a certain file structure I should be using?

Thanks in advance.

Jeff

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants