Giter Site home page Giter Site logo

netbox-config-backup's Introduction

Netbox Configuration Backup

A configuration backup system using netbox and napalm to backup devices into a git repository

Features

  • Connects to any device that supports napalm and provides both a running configuration and startup configuration
  • Stores backups in a git repository
  • Runs as a scheduled task through Django RQ
  • Only displays backups with changes
  • Provides both configuration download and diffs for point-in-time backups

Future

  • Allow github repositories
  • Add job "discovery" based on specific criteria (napalm enabled, device role switch, has primary ip as an example)
  • Add RQ job to ensure all backups are queued
  • Allow manual queueing of job
  • Add API endpoint to trigger backup
  • Add signal(s) to trigger backup

Installation

  1. Install from PyPI (pip install netbox-config-backup)
  2. Edit netbox configuration:
PLUGINS = [
    'netbox_config_backup',
    # Other plugins here
]

PLUGINS_CONFIG = {
    'netbox_config_backup': {
        # Parent folder must exist and be writable by your RQ worker and readable by the WSGI process
        'repository': '/path/to/git/repository',
        'committer': 'User <email>',
        'author': 'User <email>',
        # Freqency of backups in seconds, can be anywhere 0+ (Recommended is 1800 (30 minutes) or 3600 (1 hr)
        'frequency': 3600
    }
}
  1. Migrate: python3 netbox/manage.py migrate
  2. Copy /etc/systemd/system/netbox-rq.service to /etc/systemd/system/[email protected]
  3. Edit: /etc/systemd/system/[email protected]: ExecStart:
ExecStart=/opt/netbox/venv/bin/python3 /opt/netbox/netbox/manage.py rqworker --name ncb@%i --with-scheduler netbox_config_backup.jobs
  1. Reload systemd: systemctl daemon-reload
  2. Enable the service with x number of workers: systemctl enable ncb-rq@{1..10} (This will generate 10 worker symlinks to auto start)
  3. Start the service with x number of workers: systemctl start ncb-rq@{1..10} (This will start 10 workers)
  4. Create your first device backup

Logging

To enable logging, add the following to your configuration.py under LOGGING:

        'netbox_config_backup': {
            'handlers': ['enter_your_handlers_here'],
            'level': 'desired_log_level',
            'propagate': True,
        },

netbox-config-backup's People

Contributors

alryaz avatar dansheps avatar

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.