Skip to content

Config Diff

chuckablack edited this page Nov 11, 2020 · 4 revisions

Config Diff (configuration differences) is available for devices. When the user clicks on the 'config diff' action button for a device, quokka compares the current configuration against previously-stored versions, and displays a nice diff of the results.

The following image shows a config diff for a device in Cisco's sanbox:

The quokka implementation is pretty simplistic (remember it is a teaching tool), and as such it does not have bells and whistles, such as allowing the user to compare any arbitrary version. Instead, the way it works is thus: Quokka periodically (e.g. every hour or every day) reads the configuration from each device, and stores these versions in the DB.

Note to self: I should check the configuration when I read it, against the previous, and if it is the same, remove the previous, as it is unnecessary. This way I can keep way more versions, and greatly reduce storage requirements on the DB.

Then, when the user invokes the 'config diff' action, quokka goes to the DB, and compares the most recent configuration, against all other configurations, in descending order based on date. When it finds the first configuration that isn't exactly the same as the first one, it stops, and sends both configurations back to the quokka UI. The quokka UI then presents the two configurations side-by-side, as shown in the image below, highlighting lines which are different.


Clone this wiki locally