Package: netbox-plugin-config-officer
Config Officer - NetBox pluginNetBox plugin that deals with Cisco device configuration (collects running config from Cisco devices, indicates config changes, and checks templates compliance).A plugin forNetBoxto 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:Templates complianceInstallation and configurationWatchYouTubevideo about installation and usage of the pluginThis instruction only describes how to install this plugin intoDocker-composeinstance of NetBox.General installation steps and considerations follow theofficial guidelines.
The plugin is available as a Python package fromPyPior fromGitHub.0. Pull NetBox docker-compose version from GitHubmkdir~/netbox&&cd"$_"gitclonehttps://github.com/netbox-community/netbox-docker1. Create new docker container based on latest netbox imagecd~/netbox
gitclonehttps://github.com/artyomovs/netbox-plugin-config-officercdnetbox-plugin-config-officer
sudodockerbuild-tnetbox-myplugins.What's in the Dockerfile:FROMnetboxcommunity/netbox:latestRUNapkaddiputilsbind-toolsopenssh-clientgitCOPY./requirements.txt/COPY./netbox-plugin-config-officer/RUN/opt/netbox/venv/bin/pipinstallinstall-r/requirements.txtRUN/opt/netbox/venv/bin/pipinstall--no-warn-script-location/netbox-plugin-config-officer/2. Create local git repository and perform first commitmkdir~/netbox/netbox-docker/device_configs&&cd"$_"gitinitechohello>hello.txt
gitadd.
gitcommit-m"Initial"chmod777-R../device_configs3. Changenetboxservice in docker-compose.yml (do not delete, just add new lines and change image name)version:'3.4'services:netbox:&netbox#Changeimagenametonetbox-myplugins(oldnameisnetboxcommunity/netbox:${VERSION-latest})image:netbox-myplugins...#...Addenvironmentvariablesforgit:environment:-GIT_PYTHON_GIT_EXECUTABLE=/usr/bin/git-GIT_COMMITTER_NAME=netbox-GIT_COMMITTER_EMAIL=netbox@example.com#user:'101'<---Commentthis.Idon'tknowhowtomakesshworkwiththislineasfornow.volumes:#...addthisvolume:...-./device_configs:/device_configs:zports:-8080:80804. Update thePLUGINSparameter in the global Netboxconfiguration.pyconfig file innetbox-docker/configurationdirectoryPLUGINS=["config_officer"]Update a PLUGINS_CONFIG parameter inconfiguration.pyto 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/
sudodocker-composeup-d7. When NetBox is started - open the web interfacehttp://NETBOX_IP:8080and open Admin panel in right top corner and create elementsCustom LinksNameContent typeURLcollect_device_datadcim > devicehttp://NETBOX_IP:8080/plugins/config_officer/collect_device_config/{{ obj }}show_running_configdcim > devicehttp://NETBOX_IP:8080/plugins/config_officer/running_config/{{ obj.name }}Custom Fields (optional)NameLabelObject(s)collection_statusLast collection statusdcim > devicelast_collect_dateDate of last collectiondcim > devicelast_collect_timeTime of last collectiondcim > devicesshSSH enableddcim > deviceversionSoftware versiondcim > deviceUsageFollow theYouTubelink and to see the full installation and usage instruction.CollectionJust add all needed Custom Links and Custom Fields (optionally) and have fun.Templates complianceAfter 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.All matched templates will be merged into one big-boss template, which will be compared with an actual running-config.Schedule config collectionIf 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--requestPOST'http://NETBOX_IP:8080/api/plugins/config_officer/collection/'--header'Authorization: Token YOUR_TOKEN'--form'task="global_collection"'