A set of python scripts and an AWS Lambda function that leverages a python module that can synchronize data between Netbox and the Meraki Dashboard.
Python requimrents are contained in requirements.txt
:
pip install -r requirements.txt
You Netbox deployment must be configred with the following tags and custom fields:
Tags:
discovered
Custom Fields:
- last_seen: date
- mac: string
Note: both custom fields need to be present in Netbox object model: "DCIM > device", "IPAM > IP address"
NETBOX_URL
: URL of the Netbox instanceNETBOX_TOKEN
: Netbox API TokenMERAKI_ORG_ID
: Meraki ORG IdMERAKI_DASHBOARD_API_KEY
: Meraki API TOKENMERAKI_TIMESPAN
: Timespan for the IP Address search
This repo contains a module (meraki-netbox
) along with scripts that leverage the functions in that module. It also contains an AWS Lambda function that can call different functionality from the module depending on the event that the Lambda fucntion receives.
discover_meraki_clients.py
Description:
This script iterates through the specified organization's networks looking for networks with the discover-clients
tag. When it finds such a network, it iterates through all of the hosts in that network. For each host, it either adds it to IP Addresses
if it does not exist or updates it if it does exist. In both cases, it updates the last_seen
and mac
fields. When it adds a host, it also adds a discovered
tag to keep track of the hosts that were added through the discovery process.
A number of default make targets are provided. You can run make help
to get a short summary of each.
Useful targets:
make check
: runsyapf
andpylint
to check formatting and code correctness. A.pylintrc
is provided with some defaults to make it a little less picky.make docs
: build documentation in HTML and Markdown. By default, it will automatically generate API documentation for everyting inmyproject
. Output documents can be found indocs/build
.make clean
: cleans up generated binaries, virtualenvs, and documentationmake lambda-layer
: Creates a layer for the dependancied inrequirements.txt
and pushes to AWS Lambdamake lambda-deploy
: Packages the function and pushed to AWS Lambda
Note: See Contributing for guideline to use when contributing to this project