Discussion:
[rancid] Best way to avoid regular diffs?
Dave Ewart
2014-07-04 08:44:35 UTC
Permalink
Hello,

I've been getting repeated diffs in my Rancid reports because our
switches use dynamic VLANs. Bascially, the output from 'show vlan' is
constantly varying and there is no need to capture it: its results are
simply noise, for our purposes.

So I've been wondering about the *correct* way to prevent that output
hitting the diffs.

I've done the following:

- Copied /usr/lib/rancid/bin/rancid to a new file named
/usr/lib/rancid/bin/rancid-custom

- Modified router.db so that it refers to 'cisco-custom' instead of
'cisco'

- Modified /usr/lib/rancid/bin/rancid-fe to add an extra link from
'cisco-custom' to 'rancid-custom'

- Then edit /usr/lib/rancid/bin/rancid-custom to remove the 'show vlan'
output.

This works and does what I want, so far so good.

This seems like a robust solution, but because I've modified stock
files, I'm going to miss out on any updates to the rancid installation
that the Debian packages bring, next time there's an update.

Is my approach reasonable or can you suggest a better, more robust
approach?

Cheers,

Dave.
--
Dave Ewart
***@ceu.ox.ac.uk
Computing Manager, Cancer Epidemiology Unit
University of Oxford
N 51.7516, W 1.2152
heasley
2014-07-04 15:30:47 UTC
Permalink
Post by Dave Ewart
Hello,
I've been getting repeated diffs in my Rancid reports because our
switches use dynamic VLANs. Bascially, the output from 'show vlan' is
constantly varying and there is no need to capture it: its results are
simply noise, for our purposes.
So I've been wondering about the *correct* way to prevent that output
hitting the diffs.
- Copied /usr/lib/rancid/bin/rancid to a new file named
/usr/lib/rancid/bin/rancid-custom
- Modified router.db so that it refers to 'cisco-custom' instead of
'cisco'
- Modified /usr/lib/rancid/bin/rancid-fe to add an extra link from
'cisco-custom' to 'rancid-custom'
- Then edit /usr/lib/rancid/bin/rancid-custom to remove the 'show vlan'
output.
This works and does what I want, so far so good.
This seems like a robust solution, but because I've modified stock
files, I'm going to miss out on any updates to the rancid installation
that the Debian packages bring, next time there's an update.
Is my approach reasonable or can you suggest a better, more robust
approach?
move to rancid 3.1; copy the cisco definition from rancid.types.base to
rancid.types.conf, rename it, and remove or comment the commands you do
not want. so, no modification of stock, easier upgrades - i hope.

I believe 3.1 will also filter the vlan command anyway, if the vlan type
is dynamic (or whatever the value is).
Dave Ewart
2014-07-04 15:39:16 UTC
Permalink
Post by heasley
Post by Dave Ewart
[...]
Is my approach reasonable or can you suggest a better, more robust
approach?
move to rancid 3.1; copy the cisco definition from rancid.types.base
to rancid.types.conf, rename it, and remove or comment the commands
you do not want. so, no modification of stock, easier upgrades - i
hope.
I believe 3.1 will also filter the vlan command anyway, if the vlan
type is dynamic (or whatever the value is).
Ah, that's interesting to know. I'm using a Debian server and it has
nothing later than 2.3.8 packaged. I see a Debian bug
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=751975 asking for 3.1
to be packaged.

The method you describe is exactly the framework I was hoping to be able
to use, certainly.

Cheers,

Dave.
--
Dave Ewart
***@ceu.ox.ac.uk
Computing Manager, Cancer Epidemiology Unit
University of Oxford
N 51.7516, W 1.2152
Loading...