Config backup
Yagra ships with oxidized and backs up the configuration of the devices you switch on. It fetches them every day from a start time you set, keeps every version, and lets you open and compare them from the node.
It needs no address of its own on your network. Every login goes through the poller that already polls the device, so a device behind a remote site’s NAT is backed up like any other.
What it does
Section titled “What it does”- Fetches each switched-on device’s configuration every day, from one start time, over SSH or telnet.
- Keeps every version in a Git repository inside the deployment (the
oxdatavolume). - Shows each device’s backup on the node’s Config tab: one status card, the connection settings folded into one line, and one history of versions, saves and failed fetches.
- Finds the login by itself from the CLI logins in Nodes ▸ Credentials & secrets, without locking an account out.
- Pushes every version to one Git repository you choose, if you set one.
- Saves a device’s running configuration as its startup configuration, when an Admin asks, or by itself if you switch automatic save on.
- Warns when a device’s running configuration has gone unsaved for four hours.
- Raises an alert when a switched-on device has gone 2 days without a fetch.
Nodes ▸ Config backups lists the nodes that are backed up, with their last attempt, and those that are stopped or could be set up. The inventory tree marks the nodes that are backed up.
The node’s Config tab is built around one status card:
- The card says whether the backup works, with the last fetch, the next run and the number of versions.
- When something is wrong, the card names the problem and offers the one fix: pick the model, add a CLI login, Try again, or Fetch now.
- Connection settings folds the connection, the model, the speed and the login order into one summary line. Press it to open them.
- History lists stored versions, saves to startup and failed fetches together, newest first. Changes folds unchanged fetches into one row. All shows each one.
- View opens a version, and Compare compares it with the one before it, right under its row.
The tab wears the attention dot when the backup needs a fix or the device is unsaved.
A device that is switched on and has gone 2 days without a fetch raises Config backup not fetched for 2 days. It is a Warning on the node, delivered like any other alert.
- It closes when a fetch works, or when the backup is switched off.
- A node in a maintenance window gets no new one.
- A node that has never been fetched counts from when its backup settings were last saved.
The Config tab gives the same verdict at the same moment. Its card says Not fetched for over 2 days, and the tab wears the attention dot. That includes a node still looking for a login, whose card offers Try again.
Switching a device on
Section titled “Switching a device on”- Add the device’s login under Nodes ▸ Credentials & secrets ▸ CLI: a password, a user name, and an enable password if the device asks for one. Leave the user name empty for a device whose lines check a password alone.
- Open the node and choose its Config tab.
- Connection settings is open while the backup is off. Under Logins, in the order tried, tick the logins to try. Drag the ⠿ at a row’s left to put them in order. Select all tries every CLI login in the order of Credentials & secrets, including one added later.
- For a device that must never be reached over telnet, tick SSH only.
- Press Start backup. Yagra saves the settings and fetches at once. The button waits until at least one login is ticked.
- If the card asks for a model, pick one and press Save and fetch. It asks when neither the
node’s profile nor what the device says it is implies a model. A Cisco wireless controller is
fetched as
aireosor, for a Catalyst 9800,ios, from what it says it is.
Each ticked login shows how its last try went at the right of its row: Trying, Waiting, Refused or Fetched. While the backup is still looking for a login, the card says which login of how many it is on.
SSH only ticked before Start backup holds from the first fetch. Once the backup is on, tick it under Connection settings and press Save. Ticked only after starting, it comes too late for the first fetch: if SSH does not connect on that fetch, the next attempt goes over telnet straight away.
You do not choose between SSH and telnet. Yagra tries SSH first. When SSH does not connect, it tries the same login over telnet on the next attempt. It remembers the protocol that worked, together with the login. A login that SSH refused moves on to the next login over SSH, so a device never sees one refused login twice in a single fetch. The card and each failed attempt in the history name the protocol.
In v0.3.72, every node set to SSH or Telnet moved to this automatic search. A node whose login already worked kept the protocol it worked over. Tick SSH only on any device that must never be reached over telnet.
Since v0.3.86, SSH refuses a device that offers only Diffie-Hellman groups smaller than 2048 bits. Old devices can do that. Such a device shows a failed SSH login. Unless SSH only is ticked, the next attempt goes over telnet.
Fetch now asks for a fetch straight away. While a fetch is out it becomes Cancel fetch, which cuts the connection and records the attempt as cancelled.
Stop backup stops the backup and keeps every version.
Starting it again keeps the login that worked, so the logins ahead of it in the order are not tried on the device again. A node that had no working login searches again from the top.
Nodes ▸ Config backups switches many at once. Its filter shows Backed up, Stopped and Not set up nodes, each with a count, or All. Each row has a switch, and ticked rows are turned on or off together. A stopped node comes back with its own settings. Turning on nodes that were never set up opens a dialog with SSH only and the logins to try, none ticked at first. Tick the logins and drag them into order, or press Select all. Leave SSH only clear, and Yagra finds SSH or telnet by itself. Nodes already set up keep their own logins. Not set up lists only nodes whose profile (or, for a wireless controller, what the device says it is) names their model; the others are switched on from their Config tab.
Turning nodes on from the list does not fetch at once. Their logins are tried within the lockout limits, and the configuration is fetched in the next scheduled run. The audit log gets a row for every node switched, so who turned the backup on for a device can be found per device.
When it runs
Section titled “When it runs”Nodes ▸ Config backups shows the Backup schedule: the daily start time, how many devices are fetched at a time, the next run, and how far the current run has got.
- Press Change beside the schedule.
- Set the Start time.
- Choose At a time, from 1 to 8.
- Press Save.
The default is 02:00 UTC, one device at a time.
- The start time keeps its zone. It is a wall time in the time zone you were using when you saved it, and it stays at that wall time through daylight saving.
- Oldest backup first. Each run fetches the devices whose last backup is oldest first. A run that is interrupted carries on where it was.
- Nothing else fetches by itself. oxidized fetches only what Yagra asks for: the scheduled run, the search for a working login, and Fetch now. Restarting or upgrading Yagra therefore no longer fetches every device again. A device whose login already works is next fetched in the next scheduled run.
Pick a quiet hour, especially with automatic save on. A change half made at fetch time is saved as it stands.
How it finds a login
Section titled “How it finds a login”You do not choose a login. Yagra tries the CLI logins in the order of Credentials & secrets, remembers the one that works, and goes back to the top of the order when it stops working. Logins, in the order tried, under Connection settings, reorders them, or leaves some out, for one node.
Failed logins are limited, so neither a device nor an account shared through TACACS+ or RADIUS is locked out. Each node has a Speed:
| Speed | Between two tries | Failures per device | Failures per login, across all devices |
|---|---|---|---|
| Rapid | 1 minute | 10 an hour | 30 an hour |
| Normal | 10 minutes | 3 an hour | 5 an hour |
| Slow | 1 hour | 3 a day | 2 an hour |
A login several nodes share is held to the most careful of their speeds. A login held back by a limit is waited for, never skipped. Fetch now does not wait, and the attempt it makes counts against the limits.
A device that does not answer is not counted as a refused login. It is tried again every 10 minutes, hour or 6 hours, and given up on after 6 hours, a day or 3 days, by speed.
Once a login works, the Connection settings line names it. Search logins again, inside that section, forgets it and starts again from the top of the order, within the limits; the press itself sends nothing to the device.
Devices behind a remote site
Section titled “Devices behind a remote site”oxidized never connects to a device itself. It logs in through core, and core carries the session over the bus to the poller that polls the device, which connects to it.
- The poller connects only to a node it polls, at the address it polls it at, on port
22or23. - Neither side writes what it carries to a log.
- A poller must be on the same release as core for its devices to be backed up. Until then the node says its poller is too old, and no login reaches the device.
A telnet session carries the device’s password in the clear. On a remote site that is inside the bus’s TLS. Tick SSH only on any device whose password must not travel over telnet.
Pushing to Git
Section titled “Pushing to Git”Settings ▸ Integrations ▸ Git sets one destination for the whole deployment: GitHub, Bitbucket, GitLab or any Git server. Every new version is pushed there after the fetch that stored it.
- Every file goes under a
yagra/folder. Each device is one file,yagra/<name>.txt, and its history holds every change. A deleted device’s file moves toyagra/deleted/<name>.txt. - Reach it over HTTPS with a user name and an access token, or over SSH with a key Yagra makes. The page shows the public half to register as a deploy key with write access.
- The destination’s SSH host key is learned on the first push and shown as a fingerprint. Forget learns it again.
- Before each push Yagra fetches the branch and builds on top of it.
yagra/is replaced whole, and everything beside it stays, so you can keep other devices’ configurations in the same repository. - Yagra never force-pushes. A top-level file named
yagrais not replaced: the push is refused. Use a private repository. - Test connection asks the destination from Yagra in a few seconds and touches no device.
A failed push is retried after ten minutes. A refused login, a changed host key or a refused push opens a Warning alert at once; a destination that does not answer opens it on the second failure. The alert closes when a push goes through.
Saving to startup
Section titled “Saving to startup”Saving copies a device’s running configuration to its startup configuration, so a restart brings back what the device runs now. This is the only thing Yagra ever writes to a network device. Everything else it does to a device is a read.
- Open the node’s Config tab and press Save to startup, on the line that says the device is unsaved. Only an Admin sees the button.
- Confirm. Yagra first fetches the device. The save runs only after that fetch succeeds, so what is saved is already backed up.
- In the same login, Yagra keeps a copy of the startup configuration it is about to replace, then sends the model’s save command.
- The tab’s History lists the save: when, who asked (A person or Yagra), and how it ended. Replaced startup opens the copy that was kept.
Yagra sends only the commands in one fixed table, per model. There is no free-text command.
| Model | Prints startup | Compares running with startup | Saves |
|---|---|---|---|
Cisco IOS, IOS-XE (ios) |
show startup-config |
— (read over SNMP instead) | write memory |
Huawei VRP (vrp) |
display saved-configuration |
compare configuration |
save |
Cisco Nexus, NX-OS (nxos) |
show startup-config |
show running-config diff |
copy running-config startup-config |
A model not in the table cannot be saved. An API token cannot ask for a save, and the MCP surface has no tool for it. Every save is recorded in the audit log.
Automatic save. It is switched per node. Nodes ▸ Config backups has an Auto save column beside Backup; select rows to switch many at once. A node’s Config tab has the same switch. It is off by default. When it is on, Yagra saves that device in the same login as soon as a fetch finds it unsaved. The backup and the configuration the device restarts with then always agree.
-
Only a node that is backed up, on a model in the table above, can be switched on.
-
Switching a node’s backup off switches automatic save off with it. Switching the backup back on does not bring it back.
-
A Huawei VRP or Cisco Nexus device is compared right there, after the fetch. A Cisco device is saved when Yagra reads it as unsaved over SNMP.
-
A device that is already saved is never written to.
-
Nothing is saved in a maintenance window or during an upgrade.
-
A failed save is tried again after the next fetch. The node reads Needs attention in the list until a save goes through, and its Config tab shows the last result beside the switch.
-
The startup configuration each save replaced is kept, as it is for a save a person asks for.
Unsaved configuration
Section titled “Unsaved configuration”Yagra keeps how long a device’s running configuration has gone unsaved, in seconds, as the metric
config_unsaved_seconds. It is 0 while every change is saved.
- Cisco IOS and IOS-XE report it over SNMP. Yagra reads when the running configuration last changed and when the startup configuration was last written (CISCO-CONFIG-MAN-MIB). A device that has just restarted is not counted as unsaved: a change within ten minutes of boot is read as the device loading its startup configuration. A real edit inside those ten minutes is noticed at the next one.
- Huawei VRP reports it after each fetch, from
compare configuration. A change is noticed at the next fetch, so on the daily schedule the warning comes after that. - Cisco Nexus (NX-OS) works the same way, from
show running-config diff. These commands have not yet been tried on a real Nexus.
On a Huawei VRP device, the node’s Config tab says since when running and startup have differed.
View differences opens what compare configuration printed, right under that line. The running
configuration and the saved file sit side by side, and the rows that differ are marked. The same
view opens for a Cisco Nexus. The text goes through the same secret filter as a stored version, and
then through Yagra’s own, line by line; reading it takes the same permission.
The built-in rule Unsaved configuration warns at 14,400 seconds (four hours) after two polls in a row. Change or override it like any other threshold rule. A save that succeeds, asked for or automatic, polls the device twice straight away, so the warning closes within seconds.
Reading a configuration from an AI client
Section titled “Reading a configuration from an AI client”The MCP tool get_node_config reads a node’s stored versions, compares two of them, or shows how
the running configuration differs from startup. Its text views are off until an Admin switches
them on, signed in, under Nodes ▸ Config backups ▸ Config text for AI clients.
- Secrets are blanked twice: by oxidized, then again by Yagra. Neither pass is complete, so a secret both miss reaches the AI client. Treat the text as sensitive.
- Every read is recorded in the audit log, refused ones included.
- The list of versions answers for any token with View. The text needs Manage monitoring.
- The LLM root-cause explanation is not offered this tool.
See the MCP page for its parameters.
Permissions
Section titled “Permissions”| To | You need |
|---|---|
| See the versions, the last result and the schedule | View |
| Open or compare a configuration, fetch now, cancel a fetch | Manage monitoring |
| Open the startup configuration a save replaced | Manage monitoring |
| Change the backup schedule | Manage monitoring |
| Switch a node’s backup on, or search its logins again | Manage monitoring and Manage credentials, signed in as a person |
| Save to startup, or switch automatic save on or off | Save device configuration |
| Set the Git destination | Manage the deployment |
| Switch config text for AI clients on or off | Manage the deployment, signed in as a person |
Save device configuration is held by Admin only.
Switching a backup on and searching its logins again need a person who is signed in. An API token is
refused, even one whose role holds both permissions. A rescan asked with a token answers
login_not_permitted. An API token cannot save a device either. An account restricted to folders can do neither, and cannot change the schedule, automatic
save or config text for AI clients: the CLI logins and the schedule are shared by every folder.
What it does not do yet
Section titled “What it does not do yet”- Check a device’s SSH host key. oxidized either checks every key or none, with no trust-on-first-use, so Yagra runs it with none.
- Carry the version history in
scripts/yagra-backup.shor a relocation. Copy theoxdatavolume yourself, or keep a Git destination as the copy that leaves the box. - Alert on a single failed fetch. The node’s tab and Nodes ▸ Config backups show it. The alert comes only after 2 days without a fetch.
To turn the whole feature off, set YAGRA_OXIDIZED_URL= (empty) in .env. See the
configuration reference.