[rancid] Extra spaces being randomly added - and seen as config changes

Aaron Wasserott aaron.wasserott at viawest.com
Fri Jan 4 10:30:43 UTC 2013


RANCID is running from crontab, not from a terminal, and the user on the network devices has root-level permissions. All RANCID scripts are at 2.3.8. I am having the same issue discussed here:

http://www.gossamer-threads.com/lists/rancid/users/5887

Where it's just the email output showing a false difference, not the saved config in CVS.

I am pretty sure it's not the device either as I just got it on a ScreenOS firewall and there is no option to set terminal width, just paging (length) which is currently off. Here is an example from a ScreenOS device:

set ike gateway "xcolo" address 123.45.67.89 Main outgoing-interface "bgroup0" preshare "wLE/x18INtTxJ6sT42CM5FxvOphJ/3%YZg==" sec-level standard
+ #set ike gateway "xcolo" address 123.45.67.89 Main outgoing-interface 
+ "bgroup0" preshare <removed> sec-level standard

I also setup my internal devices to run every 1min per crontab and it only sees changes when there are actual changes. So it's something in processing the output. I did check against the rancid.conf.sample file and my config was the same. I did add the NOPIPE option recently to see if that would do anything, but it didn't.

umask 027
TMPDIR=/tmp; export TMPDIR
BASEDIR=/var/lib/rancid; export BASEDIR
PATH=/usr/lib/rancid/bin:/usr/bin:/usr/sbin:/bin:/usr/local/bin:/usr/bin; export PATH
CVSROOT=$BASEDIR/CVS; export CVSROOT
LOGDIR=$BASEDIR/logs; export LOGDIR
RCSSYS=cvs; export RCSSYS
LIST_OF_GROUPS="internal external"
MAX_ROUNDS=2; export MAX_ROUNDS
FILTER_PWDS=YES; export FILTER_PWDS
NOPIPE=YES; export NOPIPE

Anyone have any ideas how I can fix this? Thanks.

-----Original Message-----
From: Per-Olof Olsson [mailto:peo at chalmers.se] 
Sent: Wednesday, January 02, 2013 12:10 PM
To: heasley; Aaron Wasserott
Cc: rancid-discuss at shrubbery.net
Subject: Re: [rancid] Extra spaces being randomly added - and seen as config changes

heasley skrev 2013-01-02 18:24:
> Tue, Jan 01, 2013 at 02:29:02PM -0800, Aaron Wasserott:
>> I am running RANCID 2.3.8 on Ubuntu 12.04.1 LTS, Precise Pangolin, kernel 3.2.0-35-generic x86_64.
>>
>> I am seeing some odd behavior when running rancid against Cisco and Mikrotik devices. The output will sometimes have extra spaces - or line breaks maybe? - that is then seen as a config change when it's not. Two examples below. The first from a Mikrotik router and the second a Cisco router.
>>
>> In the first example an extra space was seen after "sensitive source=" . In the second example the ports listed in the VLAN output break across two lines, but sometimes only one. In this second example, I have noticed it will go back and forth. Sometimes the ports are listed all on one line, sometimes two. I have many Mikrotiks with many lines of configs, so I haven't checked to see if there is a recurring issue with the same line or not.
>>
>> -----------------
>>
>> - add name=startup-tone policy=ftp,reboot,read,write,policy,test,winbox,password,sniff,sensitive source=":for t1 from=1 to=10 step=1 do={\r\n   :for t2 from=300 to=1800 step=40 do={\r \n     :beep frequency=\$t2 length=11ms;\r \n     :delay 11ms;\r \n   }\r \n }\r \n"
>> + add name=startup-tone policy=ftp,reboot,read,write,policy,test,winbox,password,sniff,sensitive source=": for t1 from=1 to=10 step=1 do={\r \n   :for t2 from=300 to=1800 step=40 do={\r \n     :beep frequency=\$t2 length=11ms;\r \n     :delay 11ms;\r \n   }\r \n }\r \n"
>
> I suspect this is the device.  try mtlogin -c 'export' device in a 
> loop and look for the change.  the mtlogin code looks ok to me, but i 
> dont have one of these for testing.
>
>> - !VLAN: 1    default                          active    Fa2, Fa3, Fa4, Fa5, Fa6, Fa7
>> - !VLAN:                                                 Fa8, Fa9
>> + !VLAN: 1    default                          active    Fa2, Fa3, Fa4, Fa5, Fa6, Fa7, Fa8, Fa9
>>
>> -----------------
>
> this is the device itself, which i thought was due to the terminal 
> width.  but
> 2.3.8 should have the change that sets the width.  unless the use that 
> runs rancid does not have permission to alter the terminal width, i 
> havent an idea why this would be occuring.
> _______________________________________________
> Rancid-discuss mailing list
> Rancid-discuss at shrubbery.net
> http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss
>

If you upgrade to 2.3.8 it's good habit to compare the new rancid.conf.sample with current rancid.conf.

Check if you have the new settings for fixed terminal width and sort order in place, else it will differ if you run rancid from terminal window och cron.

---------rancid.conf.sample-----------------
#
TERM=network;export TERM
#
# Collating locale
LC_COLLATE="POSIX"; export LC_COLLATE
#
-----------------------------------------

/Peo
----------------------------------------------------------
Per-Olof Olsson               Email: peo at chalmers.se
Chalmers tekniska högskola    IT-service
Hörsalsvägen 5                412 96 Göteborg
Tel: 031/772 6738  Fax: 031/772 8680
----------------------------------------------------------


More information about the Rancid-discuss mailing list