Skip to main content

NetBox plugin for network devices validation

Project description

Click to view Validity docs

Validity: vendor-agnostic configuration compliance

CI Coverage Python version NetBox version

What?

Validity is the NetBox plugin to write "auto tests" for your network devices. You define compliance tests and Validity checks device state or configuration against these tests. The two most obvious use cases for such a functionality include:

  • Configuration compliance. You can make sure your devices are provisioned properly, and their config follows the rules you have defined via tests.
  • Pre- / post-configuration checks. You can make sure your network is in the expected state before or/and after configuration changes have been made. You can use Validity API to include these checks into your automation pipelines.

Validity usage workflow:

  1. Gather state/config of your devices. Pull it from Git repository or poll the devices directly.

  2. Define serialization method (the way to translate your raw data into JSON-like structure).

  3. Write compliance test as a Python expression, e.g.
    device.config["ntp-servers"] == ["1.2.3.4", "5.6.7.8"]
    or
    device.state.sh_ospf_neighbors["10.1.1.1"]["state"] == "Up"

  4. Apply created test to specific devices and get the results per device (passed or failed).

Why?

Validity helps you to concentrate on what really matters - defining the criteria of healthy and valid network and following these criteria.

Validity completely separates compliance test code from all the other things like data collection, parsing and storage. It encourages you to write short, clean and understandable compliance tests together with the mandatory description.

Key Features

  • Truly vendor-agnostic. You can easily integrate any vendor config format using TTP or a bunch of other serialization options
  • Writing compliance tests using Python expressions and JQ
  • Gathering configuration or state info directly from the devices via SSH, Telnet, Netconf or REST API.
  • Flexible selector system to apply the tests only to a specific subset of devices
  • Concept of dynamic pairs. With dynamic pair you can compare 2 different devices between each other (e.g. compare the configuration of 2 MC-LAG members).
  • Test result explanation. When some test fails, you can get the explanation of the calculation process step by step. It helps to identify the cause of the failure.
  • ORM access inside the test. You have full access to the device properties. For instance, you may leverage Configuration Contexts NetBox feature to store your desired configuration and compare it with the config collected from the device.
  • Reports and webhooks. After execution of some bunch of tests you can get the report with passed/failed statistics grouped by some Location/Site/Manufacturer/etc. Moreover, you can provision the webhook to notify an external system when compliance report is generated.
  • Test extensibility. You can define your own python functions or classes to reuse the code between multiple compliance tests.
  • Possibility to store all heavy text-based entities (like compliance tests or TTP Templates) in a Git repository

NetBox Support Policy

Unlike many other plugins, Validity supports multiple NetBox versions inside one single release.

Validity aims to support the latest 3 major/minor releases of NetBox.

For example, if latest NetBox version is 4.1, then latest Validity is going to support NetBox 4.1, 4.0 and 3.7.

Check out compatibility matrix for the details.

Download and Install

You can download Validity via pip

pip install netbox-validity

After that follow the installation guide to correctly add Validity to your NetBox.

Documentation

Read the full documentation on validity.readthedocs.io

Quick Start

A short video about first steps with Validity:

Watch the video

Contributing

Feel free to ask a Question, report an Issue or even make a PR. Read more about contribution in the CONTRIBUTING guide.

Screenshots

Report Per Device

Compliance Test

Compliance Test Result

Device Serialized Configuration

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

netbox_validity-3.0.5.tar.gz (88.6 kB view details)

Uploaded Source

Built Distribution

netbox_validity-3.0.5-py3-none-any.whl (133.6 kB view details)

Uploaded Python 3

File details

Details for the file netbox_validity-3.0.5.tar.gz.

File metadata

  • Download URL: netbox_validity-3.0.5.tar.gz
  • Upload date:
  • Size: 88.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.15

File hashes

Hashes for netbox_validity-3.0.5.tar.gz
Algorithm Hash digest
SHA256 cbbd5b69a32168626a6d9c8fa7f03f9af9ad2b44c82076d6ac20824d0eb83734
MD5 6ea8d64e3468492762a97d138c4c6cc0
BLAKE2b-256 69597bffdb5a6668b79069313a66ae1075ee6231c69344319771d7e413a3ec9a

See more details on using hashes here.

File details

Details for the file netbox_validity-3.0.5-py3-none-any.whl.

File metadata

File hashes

Hashes for netbox_validity-3.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 9e95756628bf038529520dbf462276204d28c2d3abcc801c834faac6368de341
MD5 eff4323354daa7305aa2d07d1263b54b
BLAKE2b-256 19e373f3196119101ca9bfc4bc2775f9d14cca51f87ac44c02b37b0a8e9fd045

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page