Discussion:
[rancid] Control rancid had problems parsing my routers.db file
Johnson, Matt (GE Healthcare)
2008-09-02 15:33:14 UTC
Permalink
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] =~ ***@A-***@a-z@,print <mailto:***@A-***@a-z@,print>
$_)
if ($F[2] !~ /^up\r*$/i);}' routers.db > routers.down.new

perl -F: -ane '{($F[0] =~ ***@A-***@a-z@,print <mailto:***@A-***@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.
Chris Gauthier
2008-09-02 16:09:36 UTC
Permalink
I, too, am running 8.04 LTS Server and rancid 2.3.2a7 (I think that is
the right numbers). Where did you edit the files, Windows or Linux?
That part makes a difference. Windows, by default, stores using a
<CR-LF>, where Linux (and all *nix variants, as I understand) only
record the <CR>.



If you used Windows, check your editor to make sure it is saving in a
Unix-style format (ie, not CR-LF). (shamless plug) I use EditPad Pro
(they have a Lite version) and love it!

http://www.editpadpro.com/



Chris



From: rancid-discuss-***@shrubbery.net
[mailto:rancid-discuss-***@shrubbery.net] On Behalf Of Johnson, Matt
(GE Healthcare)
Sent: Tuesday, September 02, 2008 8:33 AM
To: rancid-***@shrubbery.net
Subject: [SPAM] - [rancid] Control rancid had problems parsing my
routers.db file - Bayesian Filter detected spam



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] =~ ***@A-***@a-z@,print <mailto:***@A-***@a-z@,print>
$_)
if ($F[2] !~ /^up\r*$/i);}' routers.db > routers.down.new



perl -F: -ane '{($F[0] =~ ***@A-***@a-z@,print <mailto:***@A-***@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.
Johnson, Matt (GE Healthcare)
2008-09-02 16:37:13 UTC
Permalink
You are correct. My vim installation on windows wasn't doing what I
thought it was. Would it be a bad idea to patch control_rancid so that
it wouldn't matter which file format it would be in?

Thanks for your help Chris.

________________________________

From: Chris Gauthier [mailto:***@mapscu.com]
Sent: Tuesday, September 02, 2008 11:10 AM
To: Johnson, Matt (GE Healthcare); rancid-***@shrubbery.net
Subject: RE: [SPAM] - [rancid] Control rancid had problems parsing my
routers.db file - Bayesian Filter detected spam



I, too, am running 8.04 LTS Server and rancid 2.3.2a7 (I think that is
the right numbers). Where did you edit the files, Windows or Linux?
That part makes a difference. Windows, by default, stores using a
<CR-LF>, where Linux (and all *nix variants, as I understand) only
record the <CR>.



If you used Windows, check your editor to make sure it is saving in a
Unix-style format (ie, not CR-LF). (shamless plug) I use EditPad Pro
(they have a Lite version) and love it!

http://www.editpadpro.com/



Chris



From: rancid-discuss-***@shrubbery.net
[mailto:rancid-discuss-***@shrubbery.net] On Behalf Of Johnson, Matt
(GE Healthcare)
Sent: Tuesday, September 02, 2008 8:33 AM
To: rancid-***@shrubbery.net
Subject: [SPAM] - [rancid] Control rancid had problems parsing my
routers.db file - Bayesian Filter detected spam



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] =~ ***@A-***@a-z@,print <mailto:***@A-***@a-z@,print>
$_)
if ($F[2] !~ /^up\r*$/i);}' routers.db > routers.down.new



perl -F: -ane '{($F[0] =~ ***@A-***@a-z@,print <mailto:***@A-***@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.

Loading...