Git Product home page Git Product logo

network-config-tracker's Introduction

Overview

Network config tracker is a tool that monitors the configuration changes of your network devices using a gitlab repository. This tool requires integration to the following applications:

  • Gitlab which is used for storing the network devices configuration and to monitor the configuration changes.
  • NetBox which is used for maintaining the list of network devices to be monitored for configuration changes.

Documentation

Please refer to this link for the documentation.

Support Matrix

List of supported network device platforms and NetBox parameter configuration.

Parameters Cisco IOS Cisco IOS-XR Cisco NXOS Juniper JunOS
NetBox Platform Cisco IOS Cisco IOS-XR Cisco NXOS Juniper JunOS
NetBox Status Active Active Active Active
NetBox Primary IPv4 True True True True
Login Method SSH SSH SSH | NX-API SSH

Tested working on:

Application Version
Python 3.9
NetBox 3.4.7
GitLab 14.1.0

Installation

  1. Clone this repository and create a virtual environment.
git clone https://github.com/kagarcia1618/Network-Config-Tracker.git
cd network-config-tracker
python3.9 -m venv venv
source venv/bin/activate
  1. Install the requirements.
pip install -r requirements.txt
  1. Create a new directory named private inside the cloned git repository directory.
mkdir private
  1. Prepare the following parameter details:

    • Username - to be used to access and get the running configuration of the network devices.
    admin
    
    • Password - to be used to access and get the running configuration of the network devices.
    password
    
    • NetBox URL - to be used identify the location of local netbox installation.
    https://<hostname | ipv4 address>
    
    • NetBox API Token - to be used to access the NetBox URL API and get the list of network devices to be monitored.
    <api token>
    
    • Gitlab URL - to be used identify the location of local gitlab installation.
    https://<hostname | ipv4 address>
    
    • Gitlab Project Name - to be used to store and monitor the network devices running configuration.
    kenneth/dev-config/tracker
    

    Note: New folder named configs will be created inside the gitlab project for storing the devices running configuration.

    • Gitlab Project API Token - to be used to access the gitlab project via API.
    <api token>
    
  2. Generate the encrypted device and application credentials by running credentials.py python script. The script will generate your secret key in the private folder together with the encrypted text file for device and application login access.

python credentials.py
  1. Create a custom field named Last Config Change with date as type and assign it to dcim | device. This will be used by this tool to update the last recorded configuration change for a device.

    Note: This tool will also update the device status in Netbox based on the result of fetching the device running configuration from the actual device.

Usage

  1. Execute the config-tracker.py python script.

    python config-tracker.py
    

    Note: If you are using linux environment, you may configure a cronjob to regularly execute this job on your preferred time interval. Sample script below will execute the script every 10 minutes and store output logs to a text file.

    crontab -e
    */10 * * * * cd ~/network-config-tracker/ && venv/bin/python config-tracker.py  >> logs/access_logs.txt
    

network-config-tracker's People

Contributors

kagarcia1618 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

chpradeep23

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.