# Buildsheet autogenerated by ravenadm tool -- Do not edit. NAMEBASE= python-netbox-config-backup VERSION= 2.1.1 KEYWORDS= python VARIANTS= v12 v13 SDESC[v12]= NetBox Switch Configuration Backup Plugin (3.12) SDESC[v13]= NetBox Switch Configuration Backup Plugin (3.13) HOMEPAGE= none CONTACT= Python_Automaton[python@ironwolf.systems] DOWNLOAD_GROUPS= main SITES[main]= PYPIWHL/87/70/3cc6626999f24812a9e5975b677b87da9cd1bf34160bfc8eca614808e26f DISTFILE[1]= netbox_config_backup-2.1.1-py3-none-any.whl:main DIST_SUBDIR= python-src DF_INDEX= 1 SPKGS[v12]= single SPKGS[v13]= single OPTIONS_AVAILABLE= PY312 PY313 OPTIONS_STANDARD= none VOPTS[v12]= PY312=ON PY313=OFF VOPTS[v13]= PY312=OFF PY313=ON DISTNAME= netbox_config_backup-2.1.1.dist-info GENERATED= yes [PY312].RUN_DEPENDS_ON= python-netbox-napalm-plugin:single:v12 python-netmiko:single:v12 python-napalm:single:v12 python-uuid:single:v12 python-dulwich:single:v12 python-PyDriller:single:v12 python-deepdiff:single:v12 [PY312].USES_ON= python:v12,wheel [PY313].RUN_DEPENDS_ON= python-netbox-napalm-plugin:single:v13 python-netmiko:single:v13 python-napalm:single:v13 python-uuid:single:v13 python-dulwich:single:v13 python-PyDriller:single:v13 python-deepdiff:single:v13 [PY313].USES_ON= python:v13,wheel [FILE:2287:descriptions/desc.single] # 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: ```pyython 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 ', 'author': 'User ', # Freqency of backups in seconds, can be anywhere 0+ (Recommended is 1800 (30 minutes) or 3600 (1 hr) 'frequency': 3600 } } ``` 3. Migrate: `python3 netbox/manage.py migrate` 4. Copy /etc/systemd/system/netbox-rq.service to /etc/systemd/system/ncb-rq\@.service 5. Edit: /etc/systemd/system/ncb-rq\@.service: ExecStart: ``` ExecStart=/opt/netbox/venv/bin/python3 /opt/netbox/netbox/manage.py rqworker --name ncb@%i --with-scheduler netbox_config_backup.jobs ``` 6. Reload systemd: `systemctl daemon-reload` 7. Enable the service with x number of workers: `systemctl enable ncb-rq@{1..10}` (This will generate 10 worker symlinks to auto start) 8. Start the service with x number of workers: `systemctl start ncb-rq@{1..10}` (This will start 10 workers) 9. Create your first device backup ## Logging To enable logging, add the following to your configuration.py under LOGGING: ```python 'netbox_config_backup': { 'handlers': ['enter_your_handlers_here'], 'level': 'desired_log_level', 'propagate': True, }, ``` [FILE:133:distinfo] 9d1665912abc3abfff55b5975a4fa5cfebd33e474531086f7255d8a2989b798a 54878 python-src/netbox_config_backup-2.1.1-py3-none-any.whl