Giter Club home page Giter Club logo

meraki-to-mindmaps's Introduction

Meraki-To-MindMaps

published

Script Result

Installation for debian-based OS

Virtual Environment

We recommend running Mind_nMap in a Python virtual environment while testing or developing. This will help keep your host system clean and allow you to have multiple environments to try new things. If you are not using a virtual environment, start at the download/clone step below.

You will also need Python 3, pip, and venv installed on your host system.

In your project directory, create your virtual environment

python3 -m venv myvenv

Activate (use) your new virtual environment (Linux):

source myvenv/bin/activate

Download or clone the mind_nmap repository:

git clone https://github.com/AngelIV23/Meraki-To-MindMaps.git

Install Python packages using pip according to the requirements.txt file

pip install -r requirements.txt

If needed, you can create optionally the next folders depending on current requirements and code tweaks you'd like to make:

mkdir outputs logs

Install markmap into your environment:
``` console
sudo apt update
sudo apt install npm
sudo npm install markmap-cli -g

Create .env file which will contain the API KEY from the organization(s) with the next format:

API_KEY = <API key or token from Dashboard>

Or you can easily get the public API key and play around API calls using the Cisco Meraki Get Hands-On section:

https://developer.cisco.com/meraki/meraki-platform/

Application walkthorugh:

  1. Run the main script which will automatically gather data from corresponding key (by default, Meraki API is being used):
python meraki_api_main.py
  1. Multiple log messages will appear in the console notifying the current step including progress bar:

Progress bar

  1. Looping in as many organizations required to generate SVG files including each device current status:

svg output per OrgID

  1. Outputs 1. Markmap file for global licensing:

markmap per licensing

  1. Output 2. SVG file per each OrgID:

svg output per OrgID

Future developments

  • Gather SVG and markmap by choosing an OrgID. filename should include OrgID.
  • Gather and sort Offline / online devices within an OrgID.

meraki-to-mindmaps's People

Contributors

ainglese-dev avatar lboue avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

lboue

meraki-to-mindmaps's Issues

match device['productType'] SyntaxError: invalid syntax

Hello,

I am getting an error with Python 3.9.2 when I start your script:
(myvenv) user@raspberrypi:~/Meraki-To-MindMaps $ python meraki_api_main.py 
Traceback (most recent call last):
  File "/home/user/Meraki-To-MindMaps/meraki_api_main.py", line 13, in <module>
    from meraki_functions import *
  File "/home/user/Meraki-To-MindMaps/meraki_functions.py", line 78
    match device['productType']:
          ^
SyntaxError: invalid syntax

Could you tell me how to fix that?

Regards

AttributeError: 'Console' object has no attribute 'save_svg'

Hello Angel,

I am facing an issue with you script with this setup:

  • Python3.10
C:/Users/user/AppData/Local/Programs/Python/Python310/python.exe "c:/Users/user/Documents/Projets/Automation/VScode/repo/Meraki-To-MindMaps/meraki_api_main.py"

2022-08-24 10:47:36,556 [INFO] Loading API_KEY to system.
2022-08-24 10:47:36,557 [WARNING] Using default Meraki Always-On API KEY, create .env file for private key.
2022-08-24 10:47:36,558 [INFO] Gathering Organizations from Meraki via API
2022-08-24 10:47:37,586 [INFO] Initializing md file under outputs folder
2022-08-24 10:47:37,587 [INFO] Collecting licensing via API per 34 company(ies)
|####################################################################################################| 100.00%
2022-08-24 10:48:43,549 [INFO] Creating SVG file from collected data
                      +--------------------+--------------------------------+------------------+-----------------+------------------+

                      |             Org ID |                    Client Name | Licensing Status | Expiration date | licensed Devices |

                      +--------------------+--------------------------------+------------------+-----------------+------------------+

                      |             865776 |             Cisco Live US 2019 |  License Expired |      2020-07-15 |  "MS120-8FP": 10 |

                      |                    |                                |                  |                 |         "MV": 10 |

                      |                    |                                |                  |                 |       "MX67": 10 |

                      |                    |                                |                  |                 |   "wireless": 10 |

                      |                    |                                |                  |                 |         "Z3C": 2 |

                      +--------------------+--------------------------------+------------------+-----------------+------------------+

                      |              52636 |            Forest City - Other |               OK |      2024-08-18 |   "wireless": 20 |

                      +--------------------+--------------------------------+------------------+-----------------+------------------+

                      |             681155 |                          DeLab |               OK |      2024-10-13 |   "wireless": 40 |

                      |                    |                                |                  |                 |    "MS220-8P": 9 |

                      |                    |                                |                  |                 |        "MX65": 6 |

                      |                    |                                |                  |                 |          "MC": 4 |

                      |                    |                                |                  |                 |          "MV": 9 |

                      |                    |                                |                  |                 |     "MS220-8": 1 |

                      |                    |                                |                  |                 |          "SM": 5 |

                      |                    |                                |                  |                 |       "MX250": 1 |

                      |                    |                                |                  |                 |  "MS250-48FP": 1 |

                      +--------------------+--------------------------------+------------------+-----------------+------------------+

                      | 566327653141842188 |                    DevNetAssoc |               OK |      2025-01-31 |   "MS120-8FP": 1 |

                      |                    |                                |                  |                 |    "MS250-24": 1 |

                      |                    |                                |                  |                 |  "MS350-48LP": 1 |

                      |                    |                                |                  |                 |    "MS410-16": 1 |

                      |                    |                                |                  |                 |    "MS425-32": 1 |

                      |                    |                                |                  |                 |          "MV": 5 |

                      |                    |                                |                  |                 |       "MX100": 1 |

                      |                    |                                |                  |                 |       "MX450": 1 |

                      |                    |                                |                  |                 |        "MX67": 1 |

                      |                    |                                |                  |                 |       "MX68W": 1 |

                      |                    |                                |                  |                 |         "Z3C": 1 |

                      |                    |                                |                  |                 |    "wireless": 5 |

                      +--------------------+--------------------------------+------------------+-----------------+------------------+

                      |             463308 |                        Hi Cory |               OK |      2025-11-21 |        "MX60": 5 |

                      |                    |                                |                  |                 |        "MX65": 3 |

                      |                    |                                |                  |                 |          "MV": 8 |

                      |                    |                                |                  |                 |   "MS220-24P": 5 |

                      |                    |                                |                  |                 |  "MS220-48FP": 2 |

                      |                    |                                |                  |                 |    "wireless": 8 |

                      |                    |                                |                  |                 |   "MS220-8P": 10 |

                      |                    |                                |                  |                 |          "MC": 1 |

                      |                    |                                |                  |                 |        "SM": 101 |

                      |                    |                                |                  |                 |       "MX67C": 1 |

                      +--------------------+--------------------------------+------------------+-----------------+------------------+

                      |             549236 |                 DevNet Sandbox | License Required |      2029-07-07 |    "MS220-8P": 1 |

                      +--------------------+--------------------------------+------------------+-----------------+------------------+

                      | 573083052582914233 | organization with name changed |               OK |             N/A |                  |

                      +--------------------+--------------------------------+------------------+-----------------+------------------+

                      | 573083052582914605 |                 Jacks_test_net |               OK |             N/A |                  |

                      +--------------------+--------------------------------+------------------+-----------------+------------------+

                      | 573083052582915028 |                Next Meraki Org |               OK |             N/A |                  |

                      +--------------------+--------------------------------+------------------+-----------------+------------------+

                      | 573083052582915123 |                     BCX-Ithala |               OK |             N/A |                  |

                      +--------------------+--------------------------------+------------------+-----------------+------------------+

                      | 573083052582915124 |                     BCX-Telkom |               OK |             N/A |                  |

                      +--------------------+--------------------------------+------------------+-----------------+------------------+

                      | 575334852396582591 |           Ftreqah organization |               OK |             N/A |                  |

                      +--------------------+--------------------------------+------------------+-----------------+------------------+

                      | 575334852396582684 |                            SVR |               OK |             N/A |                  |

                      +--------------------+--------------------------------+------------------+-----------------+------------------+

                      | 575334852396582738 |                My organization |               OK |             N/A |                  |

                      +--------------------+--------------------------------+------------------+-----------------+------------------+

                      | 575334852396582755 |              Your Organization |              N/A |             N/A |            "N/A" |

                      +--------------------+--------------------------------+------------------+-----------------+------------------+

                      | 575334852396582756 |              Personal.Lekhnath |               OK |             N/A |                  |

                      +--------------------+--------------------------------+------------------+-----------------+------------------+

                      | 575334852396582973 |                DevNet Test Org |               OK |             N/A |                  |

                      +--------------------+--------------------------------+------------------+-----------------+------------------+

                      | 575334852396582986 |                DevNet Test Org |               OK |             N/A |                  |

                      +--------------------+--------------------------------+------------------+-----------------+------------------+

                      | 575334852396583031 |                My organization |               OK |             N/A |                  |

                      +--------------------+--------------------------------+------------------+-----------------+------------------+

                      | 575334852396583051 |                        Hi Cory |               OK |             N/A |                  |

                      +--------------------+--------------------------------+------------------+-----------------+------------------+

                      | 575334852396583071 |                        PM_Test |               OK |             N/A |                  |

                      +--------------------+--------------------------------+------------------+-----------------+------------------+

                      | 575334852396583093 |                   DevNet's Org |               OK |             N/A |                  |

                      +--------------------+--------------------------------+------------------+-----------------+------------------+

                      | 575334852396583128 |                             gk |               OK |             N/A |                  |

                      +--------------------+--------------------------------+------------------+-----------------+------------------+

                      | 575334852396583131 |                       thienbao |               OK |             N/A |                  |

                      +--------------------+--------------------------------+------------------+-----------------+------------------+

                      | 575334852396583133 |                        Hi Cory |               OK |             N/A |                  |

                      +--------------------+--------------------------------+------------------+-----------------+------------------+

                      | 575334852396583134 |                          Wotan |               OK |             N/A |                  |

                      +--------------------+--------------------------------+------------------+-----------------+------------------+

                      | 575334852396583158 |                        Testlab |               OK |             N/A |                  |

                      +--------------------+--------------------------------+------------------+-----------------+------------------+

                      | 575334852396583197 |                     Sample Org |               OK |             N/A |                  |

                      +--------------------+--------------------------------+------------------+-----------------+------------------+

                      | 575334852396583213 |                 sample_network |              N/A |             N/A |            "N/A" |

                      +--------------------+--------------------------------+------------------+-----------------+------------------+

                      | 575334852396583237 |                     changetest |               OK |             N/A |                  |

                      +--------------------+--------------------------------+------------------+-----------------+------------------+

                      | 575334852396583264 |                My organization |               OK |             N/A |                  |

                      +--------------------+--------------------------------+------------------+-----------------+------------------+

                      | 575334852396583536 |      TNF - The Network Factory |               OK |             N/A |                  |

                      +--------------------+--------------------------------+------------------+-----------------+------------------+

                      | 575334852396583708 |                     helloworld |               OK |             N/A |                  |

                      +--------------------+--------------------------------+------------------+-----------------+------------------+

                      | 575334852396583819 |                          test5 |               OK |             N/A |                  |

                      +--------------------+--------------------------------+------------------+-----------------+------------------+

Traceback (most recent call last):

  File "c:\Users\user\OneDrive - GFI\Documents\Projets\Automation\VScode\repo\Meraki-To-MindMaps\meraki_api_main.py", line 89, in <module>

    table_svg(pTable, "fullTable_licensing")

  File "c:\Users\user\OneDrive - GFI\Documents\Projets\Automation\VScode\repo\Meraki-To-MindMaps\meraki_functions.py", line 47, in table_svg        

    console.save_svg(f"outputs/{filename}.svg", title=filename)

AttributeError: 'Console' object has no attribute 'save_svg'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.