RANCID is an incredibly powerful tool. I’ve written about installing it
with a git backend using Ansible previously here.
This time, though, I’m going to introduce you to the first of (potentially)
several scripts that utilize RANCID. There won’t be a lot of detail, and this
script is a first rough draft. To use it, you need to have a .cloginrc and
the “binaries” that RANCID ships with must be in your path.
This script currently recognizes Cisco, Force10, Juniper (Junos-based), Juniper
(ScreenOS-based), and Dell (PowerConnect) devices. Others can be added
easily–contact me with specifics or submit a patch.
To utilize this script, you can clone the git repo (here), or you can copy
and paste the two scripts below.
As you can see, I did not enter the full name of the host. The script will
match against the first name it comes across in your router.db file(s).
This script can use a lot of work. The error catching isn’t always the best,
but I haven’t found any bugs yet (that I haven’t subsequently fixed, anyway).
The -d (debug) option doesn’t do anything yet, though, so maybe that’s a bug.