Skip to content

Latest commit

 

History

History

diode-napalm-agent

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Diode NAPALM Agent

The Diode NAPALM Agent is a lightweight network device discovery tool that uses NAPALM to streamline data entry into NetBox through the Diode ingestion service.

Get started

This is a basic set of instructions to get started using Diode NAPALM agent on a local machine.

Requirements

The Diode NAPALM Agent requires a Python runtime environment and has the following requirements:

  • importlib-metadata~=8.5
  • napalm~=5.0
  • netboxlabs-diode-sdk~=0.4
  • pydantic~=2.9
  • python-dotenv~=1.0

Instructions on installing the Diode SDK Python can be found here.

Installation

Clone the agent repository:

git clone https://github.com/netboxlabs/diode-agent.git
cd diode-agent/

Create a Python virtual environment and install the agent:

python3 -m venv venv
source venv/bin/activate
pip install ./diode-napalm-agent --no-cache-dir

Create a discovery configuration file

A configuration file needs to be created with an inventory of devices to be discovered. An example (config.sample.yaml) is provided in the agent repository. The config section needs to be updated to reflect your Diode server environment and the data section should include a list of all devices (and their credentials) to be discovered.

diode:
  config:
    target: grpc://localhost:8080/diode
    api_key: ${DIODE_API_KEY}
  policies:
    discovery_1:
      config:
        netbox:
          site: New York NY
      data:
        - hostname: 192.168.0.32
          username: ${USER}
          password: admin
        - driver: eos
          hostname: 127.0.0.1
          username: admin
          password: ${ARISTA_PASSWORD}
          optional_args:
            enable_password: ${ARISTA_PASSWORD}

Variables (using ${ENV} syntax) can be referenced in the configuration file from environmental variables or from a provided .env file.

The driver device attribute is optional. If not specified, the agent will attempt to find a match from NAPALM supported and installed drivers.

Detailed information about optional_args can be found in the NAPALM documentation.

Running the agent

Usage:

usage: diode-napalm-agent [-h] [-V] -c config.yaml [-e .env] [-w N]

Diode Agent for NAPALM

options:
  -h, --help            show this help message and exit
  -V, --version         Display Diode Agent, NAPALM and Diode SDK versions
  -c config.yaml, --config config.yaml
                        Agent yaml configuration file
  -e .env, --env .env   File containing environment variables
  -w N, --workers N     Number of workers to be used

Run diode-napalm-agent with a discovery configuration file named config.yaml:

diode-napalm-agent -c config.yaml

Supported drivers

The default supported drivers are the natively supported NAPALM drivers:

  • Arista EOS ("eos")
  • Cisco IOS ("ios")
  • Cisco IOS-XR ("iosxr")
  • Cisco NX-OS ("nxos")
  • Juniper JunOS ("junos")

For NAPALM community drivers installed in the environment, they can be referenced in the agent policy and will be used for automatic driver matching if no driver is specified.

Supported Netbox Object Types

The Diode NAPALM agent tries to fetch information from network devices about the following NetBox object types:

License

Distributed under the Apache 2.0 License. See LICENSE.txt for more information.