This document explains how Oxidized organizes device configurations in the Git repository and how the group field in router.db affects storage.
/var/lib/oxidized/repo/
This is a standard Git repository that stores all backed-up device configurations.
Your Oxidized deployment uses a single repository for all devices. This is the default and recommended configuration for most deployments.
/var/lib/oxidized/repo/
├── .git/ # Git metadata
├── README.md # Repository information
├── device-name-1 # Device config (flat file)
├── device-name-2 # Device config (flat file)
├── device-name-3 # Device config (flat file)
└── ...
- One file per device: Each device gets a single file named after the device
- Flat structure: All devices are in the root directory (no subdirectories)
- Git commits: Every config change triggers a new Git commit
- Full history:
git logshows all changes across all devices
If you have these devices in router.db:
router1:192.168.1.1:ios:core::
switch1:192.168.1.2:ios:access::
firewall1:192.168.1.3:asa:security::
Your repo will contain:
/var/lib/oxidized/repo/
├── router1 # Running config from router1
├── switch1 # Running config from switch1
└── firewall1 # Running config from firewall1
The group field (4th column) in router.db is used for logical organization and filtering, not for directory structure.
# Format: name:ip:model:group:username:password
router1:192.168.1.1:ios:core::
switch1:192.168.1.2:ios:access::
firewall1:192.168.1.3:asa:security::
- Web UI Filtering: Filter devices by group in the web interface
- API Queries: Query devices by group via REST API
- Logical Organization: Organize devices by function, location, or type
- Reporting: Generate reports for specific groups
❌ Not used for directory structure (all devices are in repo root) ❌ Not used for separate Git repositories (single repo for all) ❌ Not used for access control (all devices in same repo)
By Function:
core-routers
access-switches
distribution-switches
firewalls
wan-routers
By Location:
datacenter-1
datacenter-2
branch-office-nyc
branch-office-la
By Environment:
production
staging
development
lab
By Vendor/Model:
cisco-ios
cisco-nxos
arista-eos
juniper-junos
cd /var/lib/oxidized/repo
sudo -u oxidized git log --all --onelinecd /var/lib/oxidized/repo
sudo -u oxidized git log --all --oneline -- router1cd /var/lib/oxidized/repo
sudo -u oxidized git log --all --since="1 week ago"cd /var/lib/oxidized/repo
sudo -u oxidized git diff HEAD~1 HEAD -- router1cd /var/lib/oxidized/repo
# View history
sudo -u oxidized git log --all --oneline -- router1
# Restore from specific commit (replace COMMIT_HASH)
sudo -u oxidized git show COMMIT_HASH:router1 > /tmp/router1-restored.cfgIf you need separate Git repositories per group, you can modify the configuration. This is useful for:
- Very large deployments (thousands of devices)
- Separate access control per group
- Different Git workflows per device type
Edit /var/lib/oxidized/config/config:
output:
default: git
git:
user: Oxidized
email: oxidized@example.com
repo: /home/oxidized/.config/oxidized/repos/default.gitThen create group-specific repositories:
groups:
core-routers:
git:
repo: /home/oxidized/.config/oxidized/repos/core.git
access-switches:
git:
repo: /home/oxidized/.config/oxidized/repos/access.gitResult:
/var/lib/oxidized/repos/
├── default.git/ # Devices without specific group config
├── core.git/ # Core router configs
└── access.git/ # Access switch configs
✅ Use when:
- You have 1000+ devices
- You need separate Git workflows per group
- You want isolated repositories for compliance
- You have different retention policies per group
❌ Don't use when:
- You have < 500 devices (single repo is simpler)
- You want unified search/reporting across all devices
- You prefer simple Git operations
- Naming: Uses device name from
router.db(first column) - No extension: Files have no
.txtor.cfgextension - Case-sensitive: Device names are case-sensitive in filesystem
Each file contains the device's running configuration as retrieved by Oxidized:
! Cisco IOS Configuration
version 15.2
service timestamps debug datetime msec
service timestamps log datetime msec
...
The exact content depends on:
- Device model (
ios,nxos,asa, etc.) - Commands defined in the Oxidized model
- Device's running configuration
Oxidized generates automatic commit messages:
new node: device-name # First backup
update device-name # Config changed
delete device-name # Device removed from router.db
$ sudo -u oxidized git log --all --oneline
a1b2c3d update router1
e4f5g6h new node: switch2
i7j8k9l update firewall1
m0n1o2p update router1
- Growth: Repo size grows with number of devices and change frequency
- Compression: Git automatically compresses old commits
- Typical size: 10-50 MB for 100 devices with 1 year history
If your repository grows too large, you can prune old history:
cd /var/lib/oxidized/repo
sudo -u oxidized git reflog expire --expire=now --all
sudo -u oxidized git gc --prune=now --aggressive- Automated backups: Include
/var/lib/oxidized/repo/in system backups - Remote Git mirrors: Push to remote Git server periodically
- Retention: Keep at least 90 days of history
Causes:
- Device not reachable via network
- Credentials incorrect
- Model not supported
- SSH key issues
Check:
/var/lib/oxidized/scripts/test-device.sh device-name
podman logs oxidized | grep device-nameCause: Git lock file exists (rare)
Fix:
cd /var/lib/oxidized/repo
sudo -u oxidized rm -f .git/index.lock
sudo systemctl restart oxidizedFix:
# Edit config
sudo vi /var/lib/oxidized/config/config
# Update git settings
output:
git:
user: New Name
email: new@example.com
# Restart
sudo systemctl restart oxidized✅ Single Git repository: All devices in /var/lib/oxidized/repo/
✅ Flat structure: One file per device in repo root
✅ Groups for organization: Used in Web UI, not for directories
✅ Full Git history: All changes tracked in commits
✅ Simple operations: Standard Git commands work
- Device files are stored in repo root (no subdirectories by default)
- The
groupfield organizes devices logically, not physically - Each config change triggers a Git commit
- Use
git logandgit diffto view history - Backup the entire repo directory regularly
- DEVICE-MANAGEMENT.md: Adding, editing, and managing devices
- DIRECTORY-STRUCTURE.md: Complete file system layout
- QUICK-START.md: Common operational commands
- Oxidized Git Output: https://github.com/ytti/oxidized/blob/master/docs/Outputs.md#git
- Git Documentation: https://git-scm.com/doc