An app to check and translate Catalyst switch configs to Meraki.
Project description
merakicat
This package makes migrating Cisco Catalyst switches to Meraki Dashboard much easier.
Below is the list of configurations the tool can currently translate:
switch:
- Hostname
- Spanning Tree RSTP
- Stack
- Static Routing
port:
- Port Description
- Port Status
- Port Speed
- Port Duplex
- Port Type
- PoE Enabled
- Allowed VLANs
- Data VLAN
- Voice VLAN
- Layer 3 Interface
- STP RootGuard
- STP Loop Guard
- STP BPDU Guard
- Etherchannel LACP
Once installed, you can print the entire index of the feature encyclopedia, or to print the index based on either supported and translatable items or both, enter:
cd src
python mc_pedia [support] [translatable]
After the configuration is pushed to the Meraki dashboard, the app will present a summary of configured ports and those that were not configured.
Prerequisites
If you don't already have a Webex Teams account, go ahead and register for one. They are free.
-
You'll need to start by adding your bot to the Webex Teams website.
-
Click Create a New App
-
Click Create a Bot.
-
Fill out all the details about your bot. You'll need to set a name, username, icon (either upload one or choose a sample), and provide a description.
-
Click Add Bot.
-
On the Congratulations screen, make sure to copy the Bot's Access Token, you will need this in a second.
Installation
Python 3.11+ is recommended.
- Clone the github repository and install the requirements
git clone https://github.com/ecoen66/merakicat
cd merakicat
pip install -r requirements_dev.txt
cd src
python merakicat.py
Usage
-
The easiest way to use this module is to set a few environment variables
Note: As an alternative, you may rename mc_user_sample.py to mc_user_info.py and edit the variables there. Although more convenient, it is less secure.
Note: See ngrok for details on setting up an easy HTTP tunnel for webhooks callbacks.
export NGROK_AUTHTOKEN=<your ngrok Authtoken> export TEAMS_BOT_TOKEN=<your bot's token> export TEAMS_BOT_EMAIL=<your bot's email> export TEAMS_BOT_APP_NAME=<your bot's name> export TEAMS_EMAILS=<a comma delimited list of email addresses the bot will respond to> export IOS_USERNAME=<the ssh username for the Catalyst switches> export IOS_PASSWORD=<the ssh password for the Catalyst switches> export IOS_SECRET=<the CLI secret password for the Catalyst switches> export IOS_PORT=<the ssh port number for the Catalyst switches - usually 22> export MERAKI_API_KEY=<your meraki dashboard API key>
In addition to these settings, various debugs and a choice of PDF vs. DOCX report format can be enabled in the mc_user_info.py file.
-
This app can be run either as a Webex Teams bot or as a standalone command line program. To run it as a bot, just start it without any parameters:
cd src python merakicat.py
Bot commands include the following:
Check a Catalyst switch config for both translatable and possible Meraki features:
check [host <FQDN or IP address> | file <filespec>] [with timing] [with detail]
Note: The check command can also be used with one or more attached files through drag and drop.
Register a Catalyst switch to the Meraki Dashboard:
register [host <FQDN or IP address>] [with timing]
Claim Catalyst switches to a Meraki Network:
claim [<Meraki serial numbers>] [to <Meraki network name>] [with timing]
Translate a Catalyst switch config from a file or host to claimed Meraki serial numbers:
translate [host <FQDN or IP address> | file <filespec>] [to <Meraki serial numbers>] [with timing]
Migrate a Catalyst switch to a Meraki switch - register, claim & translate:
migrate [host <FQDN or IP address>] [to <Meraki network name>] [with timing]
Create a demo report for all features currently in the feature encyclopedia:
demo report
-
To run it from the command line (or from a shell script), enter any of the following:
Check a Catalyst switch config for both translatable and possible Meraki features:
check host <FQDN or IP address> | file <filespec> [with timing] [with detail]
Register a Catalyst switch or stack to the Meraki Dashboard:
register host <FQDN or IP address> [with timing]
Claim Catalyst switches to a Meraki Network:
claim <Meraki serial numbers> to <Meraki network name> [with timing]
Translate a Catalyst switch or stack config from a file or host to claimed Meraki serial numbers:
translate host <FQDN or IP address> | file <filespec> to <Meraki serial numbers> [with timing]
Migrate a Catalyst switch to a Meraki switch - register, claim & translate:
migrate host <FQDN or IP address> to <Meraki network name> [with timing]
Create a demo report for all features currently in the feature encyclopedia:
demo report
ngrok for usage as a bot
ngrok will make it easy for you to interact with meraki cat as a bot.
You can find account instructions here under Sign up for free!
: https://dashboard.ngrok.com/login
-
After you've created an
ngrok
account, you will need to get your Authtoken. Click onYour Authtoken
on the ngrok dashboard and copy it. -
You can now export it to the OS environment variables like this:
export NGROK_AUTHTOKEN=<your ngrok Authtoken>
-
Now launch the bot!!
python merakicat.py
Credits
This project is heavily based on the work of others:
Catalyst_to_Meraki_Migration_Tool
by Fady Sharobeem.
Catalyst_2_Meraki_Config_Checker
by Fady Sharobeem.
The bot functionality is based on the webexteamsbot
project by Hank Preston.
The initial packaging of the original ciscosparkbot
project was done by Kevin Corbin.
History
0.0.14 (03-19-2024)
- Option added for check with drag and drop files in bot mode.
- Added missing timing in check report in bot mode.
- Still not yet released on PyPI.
0.0.13 (03-18-2024)
- Option added for detailed check report "with detail".
0.0.12 (03-15-2024)
- Option for PDF vs. DOCX reporting in checker.
- Layer 3 Interfaces (interface VLAN) supported.
- Static routes supported.
- Command added for "demo report".
0.0.11 (03-12-2024)
- New reporting in checker.
- Port-channel LACP is working and fast.
0.0.10 (03-08-2024)
- Using a single mc_pedia.
0.0.9 (03-07-2024)
- Using both config_pedia and check_pedia.
- Changed to ngrok API for bot functionality
0.0.8 (03-01-2024)
- Lots of comment blocks added.
0.0.7 (03-01-2024)
- Now using batch port updates to Meraki dashboard.
0.0.6 (03-01-2024)
- Some light refactoring of mc_translate module.
- More prep work for Uplink config.
0.0.5 (02-29-2024)
- Added Catalyst NM module recognition and prep work for Uplink config.
0.0.4 (02-28-2024)
- Removed external data fetch for list of unsupported features in prep for adding display of features that are semi-supported.
- Added command line help python merakicat.py help.
0.0.3 (02-27-2024)
- Created command line option vs BOT.
- Just try python merakicat.py convert host to .
0.0.2 (02-26-2024)
- Not yet released on PyPI.
0.0.1 (02-26-2024)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for merakicat-0.0.14-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1d70a2b642791b51094c495f9a749a00b9461a6be9fa6b8d54e526ea39224bfa |
|
MD5 | ee37ddff5677048ddb3c811f422b0c29 |
|
BLAKE2b-256 | 01cf5ad68b9c0ebd9345b9e6a7ec9f44a114743814d31bea79526363fe23f535 |