NetBox plugin that stores configuration diffs and checks templates compliance

Overview

Config Officer - NetBox plugin

NetBox plugin that deals with Cisco device configuration (collects running config from Cisco devices, indicates config changes, and checks templates compliance).

A plugin for NetBox to work with running-configuration of Cisco devices.

Compatible with NetBox 2.9 and higher versions only.

  • Collect actual information from Cisco devices (running_config, version, IP addresses, etc.) and shows it on a dedicated NetBox page.
  • Save Cisco running configuration in a local directory and display all changes with git-like diffs.
  • Set up configuration templates for distinct device roles, types.
  • Audit whether devices are configured according to appropriate template.
  • Export template compliance detailed information to Excel.

Preview.

Collect devices data: collect devices data

Templates compliance templates compliance

Installation and configuration

Watch YouTube video about installation and usage of the plugin

This instruction only describes how to install this plugin into Docker-compose instance of NetBox.

General installation steps and considerations follow the official guidelines. The plugin is available as a Python package from PyPi or from GitHub.

0. Pull NetBox docker-compose version from GitHub

mkdir ~/netbox && cd "$_"
git clone https://github.com/netbox-community/netbox-docker

1. Create new docker container based on latest netbox image

cd ~/netbox
git clone https://github.com/artyomovs/netbox-plugin-config-officer
cd netbox-plugin-config-officer
sudo docker build -t netbox-myplugins .

What's in the Dockerfile:

FROM netboxcommunity/netbox:latest
RUN apk add iputils bind-tools openssh-client git
COPY ./requirements.txt /
COPY . /netbox-plugin-config-officer/
RUN /opt/netbox/venv/bin/pip install install -r /requirements.txt
RUN /opt/netbox/venv/bin/pip install  --no-warn-script-location /netbox-plugin-config-officer/

2. Create local git repository and perform first commit

mkdir ~/netbox/netbox-docker/device_configs && cd "$_"
git init
echo hello > hello.txt
git add .
git commit -m "Initial"
chmod 777 -R ../device_configs

3. Change netbox service in docker-compose.yml (do not delete, just add new lines and change image name)

version: '3.4'
services:
  netbox: &netbox
    # Change image name to netbox-myplugins (old name is netboxcommunity/netbox:${VERSION-latest})
    image: netbox-myplugins
    ...
    #...Add environment variables for git:
    environment:
      - GIT_PYTHON_GIT_EXECUTABLE=/usr/bin/git
      - GIT_COMMITTER_NAME=netbox
      - [email protected]
    # user: '101' <---   Comment this. I don't know how to make ssh work with this line as for now.
    volumes:        
    #...add this volume:...
      - ./device_configs:/device_configs:z
    ports:
    - 8080:8080

4. Update the PLUGINS parameter in the global Netbox configuration.py config file in netbox-docker/configuration directory

PLUGINS = [
    "config_officer"
]

Update a PLUGINS_CONFIG parameter in configuration.py to change plugin's options:

PLUGINS_CONFIG = {
    "config_officer": {
        # Credentials to cisco devices:
        "DEVICE_USERNAME": "cisco",
        "DEVICE_PASSWORD": "cisco",

        # Mount this directory to NetBox on docker-compose.yml
        "NETBOX_DEVICES_CONFIGS_DIR": "/device_configs",

        # Add these custom fields to NetBox in advance.
        "CF_NAME_SW_VERSION": "version",
        "CF_NAME_SSH": "ssh",
        "CF_NAME_LAST_COLLECT_DATE": "last_collect_date",
        "CF_NAME_LAST_COLLECT_TIME": "last_collect_time",
        "CF_NAME_COLLECTION_STATUS": "collection_status"
    }
}

6. Start Docker-compose

$ cd ~/netbox/netbox-docker/
sudo docker-compose up -d

7. When NetBox is started - open the web interface http://NETBOX_IP:8080 and open Admin panel in right top corner and create elements

Custom Links

Name Content type URL
collect_device_data dcim > device http://NETBOX_IP:8080/plugins/config_officer/collect_device_config/{{ obj }}
show_running_config dcim > device http://NETBOX_IP:8080/plugins/config_officer/running_config/{{ obj.name }}

Custom Fields (optional)

Name Label Object(s)
collection_status Last collection status dcim > device
last_collect_date Date of last collection dcim > device
last_collect_time Time of last collection dcim > device
ssh SSH enabled dcim > device
version Software version dcim > device

Usage

Follow the YouTube link and to see the full installation and usage instruction.

Collection

Just add all needed Custom Links and Custom Fields (optionally) and have fun.

Templates compliance

After plugin is installed, additional menu "Plugin" will appear in top navi panel. For templates compliance feature you need to follow this three-step scenario:

  • Step1. Add template (e.g. for particular section)
  • Step2. Add a service. Inside service, add service rules, that will match template for particular device roles and device types.
  • Step3. Attach service to devices.

compliance_list

All matched templates will be merged into one big-boss template, which will be compared with an actual running-config.

Schedule config collection

If you want to schedule global collection from all devices (e.g. every night at 3 a.m, like all cron-users do.) - you could use API. Just add this line to cron:

curl --location --request POST 'http://NETBOX_IP:8080/api/plugins/config_officer/collection/' --header 'Authorization: Token YOUR_TOKEN' --form 'task="global_collection"'
Comments
  • 404 Page not found

    404 Page not found

    Hi,

    Thanks for the plugin, similar I gave it a go after watching your YouTube video and installed it through PyPi. (NetBox version v2.10.3) However getting a "Page not found error" when running the "collect_device_data".

    Not sure where I can look to troubleshoot what might be going wrong.

    cheers

    Alexander

    opened by alexanderdeca 7
  • NetBox v3.0 Support

    NetBox v3.0 Support

    As an FYI here is what changed that could impact or help the plugin:

    • HTML Template updates (support change from bootstrap 3 to bootstrap 5)
    • Overall UI tweaks
    • Custom Queue Support for Plugins netbox-community/netbox/issues/6651

    If you find any issues or have any questions feel free to hit us on the slack or add a bug /issue or add to the umbrella UI issue netbox-community/netbox/issues/6797

    opened by ryanmerolle 3
  • NameSlugSearchFilterSet Problem

    NameSlugSearchFilterSet Problem

    Hi! After install without docker, i have a problem:

    <class 'ImportError'>
    
    cannot import name 'NameSlugSearchFilterSet' from 'utilities.filters' (/opt/netbox/netbox/utilities/filters.py)
    
    Python version: 3.8.5
    NetBox version: 2.11.3
    

    How i may fix it ?

    opened by Sivolen 3
  • Cannot start service netbox-housekeeping

    Cannot start service netbox-housekeeping

    Hi. I can not deploy netbox-plugin config-officer. I received an error trying to create netbox-docker_netbox-housekeeping_1_2da30c. Could you help me with this? I'm following step-by-step, from github and youtube.

    I'm using Ubuntu: 20.04.3 LTS with vagrant/virtualbox.

    Creating netbox-docker_redis_1_eda484f67269 ... done Creating netbox-docker_postgres_1_d9596c0d647a ... done Creating netbox-docker_redis-cache_1_bbd69de6aef9 ... done Recreating netbox-docker_netbox-housekeeping_1_2da30cc7e86e ... error Creating netbox-docker_netbox-worker_1_269284fe7c9d ...

    ERROR: for netbox-docker_netbox-housekeeping_1_2da30cc7e86e Cannot start service netbox-housekeeping: driver failed programming external connectivity on endpoint netbox-docker_netbox-housekeeping_1_2da30cc7e86e (Creating netbox-docker_netbox-worker_1_269284fe7c9d ... done Creating netbox-docker_netbox_1_28722ab27218 ... error

    ERROR: for netbox-docker_netbox_1_28722ab27218 Cannot start service netbox: driver failed programming external connectivity on endpoint netbox-docker_netbox_1_5cb5c8adec32 (d5516554e621d0452f9d64074071c81e5f64ef273582c0540b1a5c33f535a116): Bind for 0.0.0.0:8080 failed: port is already allocated

    opened by pslencinas 1
  • Transitioning to a more standard configuration collection engine

    Transitioning to a more standard configuration collection engine

    This project looks great. This is something I have had long on my to-do list for our org and I am happy to see someone else needing almost the exact same functionality. My proposition is to replace or extend collect.py's functionality to allow for a more robust configuration collection engine. To be specific, there are already several well designed network configuration collection softwares that can be hooked into to get the same data

    If this is something the author would be willing to accept, I can begin working on a PR

    opened by MajesticFalcon 1
  • Problem for install plugin

    Problem for install plugin

    Hi,

    I'm the problem for install the plugin 'config_officer' (https://github.com/artyomovs/netbox-plugin-config-officer).

    I tried using docker but I get the wrong below: -- > ImportError: cannot import name 'PrimaryModelFilterSet' from 'netbox.filtersets' (/opt/netbox/netbox/netbox/filtersets.py)

    I tried using pip install netbox-plugin-config-officer, it installed but after configure and restart service I get the mensage:

    <class 'django.urls.exceptions.NoReverseMatch'>

    'config_officer' is not a registered namespace inside 'plugins'

    Python version: 3.8.10 NetBox version: 3.2.5-dev

    opened by RenatoPereira91 1
  • Installation problem

    Installation problem

    Installation problem

    <class 'ImportError'>

    cannot import name 'NameSlugSearchFilterSet' from 'utilities.filters' (/opt/netbox/netbox/utilities/filters.py)

    Python version: 3.9.2 NetBox version: 3.1.5

    opened by whitejuly07 0
  • No docker install problem

    No docker install problem

    Hello. I installed the plugin via upgrade.sh knowingly downloading it via pip and adding it to local_requirements.txt. I also added the plugin to configuration.py When I start the web interface I get

    <class 'ImportError'>

    cannot import name 'COL_TENANT' from 'tenancy.tables' (/opt/netbox/netbox/tenancy/tables.py)

    Python version: 3.8.5 NetBox version: 2.11.0

    opened by tetesh 0
Releases(netbox-plugin)
Owner
null
NetBox plugin for BGP related objects documentation

Netbox BGP Plugin Netbox plugin for BGP related objects documentation. Compatibility This plugin in compatible with NetBox 2.10 and later. Installatio

Nikolay Yuzefovich 133 Dec 27, 2022
Zero configuration Airflow plugin that let you manage your DAG files.

simple-dag-editor SimpleDagEditor is a zero configuration plugin for Apache Airflow. It provides a file managing interface that points to your dag_fol

null 30 Jul 20, 2022
This programm checks your knowlege about the capital of Japan

Introduction This programm checks your knowlege about the capital of Japan. Now, what does it actually do? After you run the programm you get asked wh

null 1 Dec 16, 2021
JTEX is a command line tool (CLI) for rendering LaTeX documents from jinja-style templates.

JTEX JTEX is a command line tool (CLI) for rendering LaTeX documents from jinja-style templates. This package uses Jinja2 as the template engine with

Curvenote 15 Dec 21, 2022
An MkDocs plugin that simplifies configuring page titles and their order

MkDocs Awesome Pages Plugin An MkDocs plugin that simplifies configuring page titles and their order The awesome-pages plugin allows you to customize

Lukas Geiter 282 Dec 28, 2022
An MkDocs plugin to export content pages as PDF files

MkDocs PDF Export Plugin An MkDocs plugin to export content pages as PDF files The pdf-export plugin will export all markdown pages in your MkDocs rep

Terry Zhao 266 Dec 13, 2022
MkDocs plugin for setting revision date from git per markdown file

mkdocs-git-revision-date-plugin MkDocs plugin that displays the last revision date of the current page of the documentation based on Git. The revision

Terry Zhao 48 Jan 6, 2023
MkDocs Plugin allowing your visitors to *File > Print > Save as PDF* the entire site.

mkdocs-print-site-plugin MkDocs plugin that adds a page to your site combining all pages, allowing your site visitors to File > Print > Save as PDF th

Tim Vink 67 Jan 4, 2023
Ultimaker Cura 2 Mooraker Upload Plugin

Klipper & Cura - Cura2MoonrakerPlugin Allows you to upload Gcode directly from Cura to your Klipper-based 3D printer (Fluidd, Mainsailos etc.) using t

null 214 Jan 3, 2023
Poetry plugin to export the dependencies to various formats

Poetry export plugin This package is a plugin that allows the export of locked packages to various formats. Note: For now, only the requirements.txt f

Poetry 90 Jan 5, 2023
Crystal Smp plugin for show scoreboards

MCDR-CrystalScoreboards Crystal plugin for show scoreboards | Only 1.12 Usage !!s : Plugin help message !!s hide : Hide scoreboard !!s show : Show Sco

CristhianCd 3 Oct 12, 2021
AiiDA plugin for the HyperQueue metascheduler.

aiida-hyperqueue WARNING: This plugin is still in heavy development. Expect bugs to pop up and the API to change. AiiDA plugin for the HyperQueue meta

AiiDA team 3 Jun 19, 2022
A Sublime Text plugin to select a default syntax dialect

Default Syntax Chooser This Sublime Text 4 plugin provides the set_default_syntax_dialect command. This command manipulates a syntax file (e.g.: SQL.s

null 3 Jan 14, 2022
Autolookup GUI Plugin for Plover

Word Tray for Plover Word Tray is a GUI plugin that automatically looks up efficient outlines for words that start with the current input, much like a

Kathy 3 Jun 8, 2022
Plover jyutping - Plover plugin for Jyutping input

Plover plugin for Jyutping Installation Navigate to the repo directory: cd plove

Samuel Lo 1 Mar 17, 2022
Code for our SIGIR 2022 accepted paper : P3 Ranker: Mitigating the Gaps between Pre-training and Ranking Fine-tuning with Prompt-based Learning and Pre-finetuning

P3 Ranker Implementation for our SIGIR2022 accepted paper: P3 Ranker: Mitigating the Gaps between Pre-training and Ranking Fine-tuning with Prompt-bas

null 14 Jan 4, 2023
🏆 A ranked list of awesome python developer tools and libraries. Updated weekly.

Best-of Python Developer Tools ?? A ranked list of awesome python developer tools and libraries. Updated weekly. This curated list contains 250 awesom

Machine Learning Tooling 646 Jan 7, 2023
ReStructuredText and Sphinx bridge to Doxygen

Breathe Packagers: PGP signing key changes for Breathe >= v4.23.0. https://github.com/michaeljones/breathe/issues/591 This is an extension to reStruct

Michael Jones 643 Dec 31, 2022
Watch a Sphinx directory and rebuild the documentation when a change is detected. Also includes a livereload enabled web server.

sphinx-autobuild Rebuild Sphinx documentation on changes, with live-reload in the browser. Installation sphinx-autobuild is available on PyPI. It can

Executable Books 440 Jan 6, 2023