Category Archives: rancid

Adding the “last commit” line back into your Junos RANCID commits

As of RANCID 3.7, an annoying change was made by the authors of RANCID. The “last commit” line was removed from Junos-based device diiffs.

http://www.shrubbery.net/pipermail/rancid-announce/2017-September/000031.html

junos.pm: filter cycling & useless last commit config line

This wasn’t a switch that we could easily turn on or off, depending on your preference either. We had to dig through the code to re-enable this “useless” feature.

Find your junos.pm file and comment out the following line:

next if (/^## last commit: /i);

The “last commit” line will be present again upon your next RANCID run.

For another valuable RANCID tip, check out another article we wrote.

Making RANCID more intuitive

Far too often RANCID sends me emails containing diffs that looks something like this:

@@ -2761,9 +2761,9 @@
          unit 0 {
              family ethernet-switching {
                  interface-mode trunk;
                  vlan {
-                     members [ 6 8 304 314 320 ];
+                     members [ 6 8 304 314 320 323 ];
                  }
              }
          }
      }

While the information that a change was made is very helpful, it doesn’t help that the diff by default only shows the four lines above and below the changes to the configuration.

I find that doubling that output from four lines to eight lines puts everything into proper context. To do this, find your control_rancid file on your server. Open up your favorite editor and search for the string “cvs -f diff -u -4” and simply change “-4” to “-8”.