support for RANCID version 3.x
prasad1989 opened this issue · 6 comments
Hi,
I successfully configured the rancid 3.1 with centos 7 i want to add vendortable dictionary to file rancid-fe but do not know where to exactly add line. i insert line end of file but not working. Please check the rancid-fe file for reference.
! /usr/bin/perl
require 5;
my($script);
my($router, $devtype) = split(';', $ARGV[0]);
$devtype =~ tr/[A-Z]/[a-z]/;
if (! length($devtype)) {
printf(STDERR "unknown router manufacturer for $router: $devtype\n");
exit(-1);
}
foreach $file ("/usr/local/rancid/etc/rancid.types.base",
"/usr/local/rancid/etc/rancid.types.conf") {
open(INPUT, "< $file") || die "Could not open
while () {
chomp;
my($type, $directive, $value) = split(';');
$type =~ tr/[A-Z]/[a-z]/;
$directive =~ tr/[A-Z]/[a-z]/;
if ($type eq $devtype && $directive eq "script") {
$script = $value;
close(INPUT);
goto FOUND;
}
}
close(INPUT);
}
FOUND:
if (! defined($script)) {
printf(STDERR "unknown router manufacturer for $router: $devtype\n");
exit(-1);
} else {
exec($script . " $router");
}
printf(STDERR "exec($script) failed router manufacturer
exit(-1);
'cisco-sb' => 'csbrancid',
It seems that RANCID 3.X has changed considerably and the installation procedure of these scripts has changed. Please recover the original version of rancid-fe file and follow next steps.
Could you very the following steps and tell me if this works?? (to include them in the README.md of the project)
- Download src/csblogin and src/csbrancid files and put them in the RANCID's PATH (in my case, /opt/rancid/bin). Don't forget to give them execution permissions.
- In the configuration directory of RANCID (in my case, /opt/rancid/etc), add the following lines to the rancid.types.conf file (create it if necessary, and do not modify the rancid.types.base file):
cisco-sb;script;csbrancid
cisco-sb;login;csblogin
I added this instructions in commit f6c3fa4 but I need that someone tells me if they are right.
Thanks for creating this script. It's been extremely useful in environments where i support these devices. One issue I have seems to be with the Uptime changing on the device, so it causes rancid to send diffs every hour:
!Unit Up time
!---- ---------------
- ! 1 253,00:32:08
- ! 1 253,01:32:09
Please let me know how to go about excluding these changes from updates.
Thanks!
I configured this with Rancid 3.6.1 (from Debian backports) for device SG300-28. It works like a charm.
Thanks for addon!
Thanks for confirming that the setup for rancid 3.x is right!