[rancid] Control rancid had problems parsing my routers.db file

Johnson, Matt (GE Healthcare) Matthew.Johnson1 at med.ge.com
Tue Sep 2 15:33:14 UTC 2008


Hi everyone.  I'm a new user of rancid.  In setting up my installation,
I was going batty trying to figure out why all the entries in my
router.db file ended up in the routers.down file.  I started monkeying
around in control_rancid and discovered that I needed to add the \r* to
the following lines:
 
perl -F: -ane '{($F[0] =~ tr at A-Z@a-z@,print <mailto:tr at A-Z@a-z@,print>
$_)
    if ($F[2] !~ /^up\r*$/i);}' routers.db > routers.down.new
 
perl -F: -ane '{($F[0] =~ tr at A-Z@a-z@,print <mailto:tr at A-Z@a-z@,print>
"$F[0]:$F[1]\n")
    if ($F[2] =~ /^up\r*$/i);}' routers.db > routers.up.new
 
I have only used vim to edit the router.db file (albiet both on windows
and linux) so didn't expect to have issues with goofy line feeds that
sometimes creep up when using things like windows wordpad.  
 
I post this to the users on the list to see if I'm just doing something
wrong, and also to give this simple fix to anyone else having problems
with their routers ending up in the routers.down file.
 
I'm running perl v5.8.8 on Ubuntu 8.0.4.
 
Thanks everyone.  Its a pretty slick tool once I got it going.
 
 
 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.shrubbery.net/pipermail/rancid-discuss/attachments/20080902/3122d5a0/attachment.html 


More information about the Rancid-discuss mailing list