Clogin Options

Stafford A. Rau srau at
Fri Sep 23 18:22:15 UTC 2005

I often use this sort of thing:

#!/usr/bin/perl -w

my @routers;
my $clogin = "/usr/local/rancid2/bin/clogin";
my $clogin_cmd = "-c conf t\nconfig line blah\nconfig line 2 blah\nexit\nwrite\n\n";

open ROUTERDB, "/usr/local/rancid2/group_name/router.db" or
        die "Can't open router.db: $!";
while (<ROUTERDB>) {
        if ( /\:down$/ ) { next; }
        push @routers, ($_);

for my $router (@routers) {
        chomp $router;
        print "===$router===\n";
        system ( "$clogin", "$clogin_cmd", "$router" );

For more complicated configs, I use clogin to just tell the router to do
a copy tftp: run; write; and I put the config in a tftp server
accessible file.


More information about the Rancid-discuss mailing list