wraprancid

wraprancid is based on wrancid by from Michael Stefaniuc (see this mailing list thread).

In brief, w(rap)rancid permits a arbitrary third-party script to be used to obtain the configuration for a device, rather than expecting rancid itself to obtain it through clogin/etc. This permits rancid to be used as a tool for backing up and monitoring changes on a class of devices that do not have a useable CLI, or which cannot write a textual configuration to the terminal, as long as some method exists for pulling a textual configuration from the device (for example, by invoking transfer to tftp/ftp server via SNMP or CLI, or using scp to retrieve the configuration file).

Michael's original wrancid was written for earlier rancid; rancid 2.3.2 or so changed rancid-fe substantially so that the patch no longer applied.

Michael's original code is released under the GPL. The post supplies a sample plugin which will obtain a configuration from a Cisco (Altera) VPN Concentrator, which should still be useable.

For using wraprancid under rancid v3.x, please see this excellent post from Howard Jones.

How To Use

    1. Patch rancid-fe with patch provided below

    2. Modify router.db to add an entry for wraprancid, appending the plugin name to deal with your special device

    3. Install wraprancid in bindir

    4. Create a plugin script and place in bindir

For example, if you write a plugin for a device "NoCLI", you might place it in the bindir (ie, the place where rancid, rancid-fe, clogin, etc are installed) called nocli.wrapplugin, then add something like the following line to your router.db:

10.1.22.101:wraprancid-nocli:up

Notes

wrancid is now called wraprancid, for clarity.

It expects the plugins to be in the bindir with a .wrapplugin extension.

The rancid-fe patch makes the following changes:

    1. replace "router" with "device" throughout;

    2. added support for a hyphen-separated argument to be passed for the vendor script;

    3. added an entry to the vendor list for wraprancid;

    4. improved error message clarity.

You should note Michael's original comments in his post:

i have attached a proof of concept code which works for me but is a quick hack and NOT ready for production. Use on your own risk. ... Possible improvements of wrancid would be to parse .cloginrc and pass the username/password down to the plugin scripts making those easier but that needs to be done securely (no command line and no enviroment). At the moment vpn3k has it hard coded in the file (did i say that it is proof of concept code?). And the scripts would need some error handling too. ... WARNING: This is only PROOF OF CONCEPT code and will screw up your data and eat babies!!!

Files

There are two main files that you need; the first is a patch for rancid-fe.in which must be applied on rancid 3. See Howard's post referenced above regarding rancid 3.x. The other is the wraprancid script itself. Obtain the files from here.

Here is a copy of Michael's post to rancid-discuss.

Status

Update submitted to John Heasley 16 Mar 2008, along with a query about the licence. No specific reply received.