Mailing List Archive

Excluding config lines in Rancid
Rancid is detecting configuration changes on a few configuration items in
Cisco switch configurations that are automatically updated and Rancid
should exclude from it's comparisons.

On a Cisco Catalyst 3560 switch running software version 12.2(25)SEE4
Rancid is reporting changes to the "ntp clock-period" command:

- ntp clock-period 36029104
+ ntp clock-period 3602910

On a Cisco Nexus 3548 switch running software version 6.0(2)A1(1e) Rancid
is reporting changes to the following configuration items:

!Env: INTAKE 45 29
+ !Env: INTAKE 45 28

- !Flash: bootflash: 5356844 Apr 22 17:42:48 2014
BufferMonitor-1HourData
+ !Flash: bootflash: 5356844 Apr 22 20:42:48 2014
BufferMonitor-1HourData

Can Rancid be configured to ignore changes in these lines?

I am currently running Rancid 3.0, but had the same issue in 2.3.6 and
2.3.8.

Thanks.

--Vincent
Re: Excluding config lines in Rancid [ In reply to ]
Sure, this topic is something of an FAQ.


* Edit the rancid executable (or whatever executable you happen to be using to collect the data)

* Most of the stuff for normal commands will be in the 'WriteTerm' callback (see CommandTable)

* There should already be an ntp clock-period match in there somewhere. In mine, it looks like this:

# Dog gone Cool matches to process the rest of the config

/^tftp-server flash / && next; # kill any tftp remains

/^ntp clock-period / && next; # kill ntp clock-period

/^ length / && next; # kill length on serial lines

/^ width / && next; # kill width on serial lines

* Next find the ShowEnv subroutine

o Look for 'next if' in the while (<INPUT>) loop. Add a line above or below that says: next if (/INTAKE/)

* Similarly for ShowFlash subroutine, add a next if (/bootflash/) if you don't want to see bootflash.



'next if' is the generic answer about how to eliminate things. Look in @commandtable to find the command that gets executed, that maps to a callback. Go to the callback and add a 'next if'.

From: rancid-discuss-bounces@shrubbery.net [mailto:rancid-discuss-bounces@shrubbery.net] On Behalf Of Vincent Aniello
Sent: Wednesday, April 23, 2014 10:50 AM
To: rancid-discuss@shrubbery.net
Subject: [rancid] Excluding config lines in Rancid

Rancid is detecting configuration changes on a few configuration items in Cisco switch configurations that are automatically updated and Rancid should exclude from it's comparisons.

On a Cisco Catalyst 3560 switch running software version 12.2(25)SEE4 Rancid is reporting changes to the "ntp clock-period" command:

- ntp clock-period 36029104
+ ntp clock-period 3602910

On a Cisco Nexus 3548 switch running software version 6.0(2)A1(1e) Rancid is reporting changes to the following configuration items:

!Env: INTAKE 45 29
+ !Env: INTAKE 45 28

- !Flash: bootflash: 5356844 Apr 22 17:42:48 2014 BufferMonitor-1HourData
+ !Flash: bootflash: 5356844 Apr 22 20:42:48 2014 BufferMonitor-1HourData

Can Rancid be configured to ignore changes in these lines?

I am currently running Rancid 3.0, but had the same issue in 2.3.6 and 2.3.8.

Thanks.

--Vincent
Re: Excluding config lines in Rancid [ In reply to ]
Wed, Apr 23, 2014 at 10:49:49AM -0400, Vincent Aniello:
> Rancid is detecting configuration changes on a few configuration items in
> Cisco switch configurations that are automatically updated and Rancid
> should exclude from it's comparisons.
>
> On a Cisco Catalyst 3560 switch running software version 12.2(25)SEE4
> Rancid is reporting changes to the "ntp clock-period" command:
>
> - ntp clock-period 36029104
> + ntp clock-period 3602910

this be filtered by stock rancid 3.0. i can not imagine why it would be
missed until the device were not configured as 'cisco'.

> On a Cisco Nexus 3548 switch running software version 6.0(2)A1(1e) Rancid
> is reporting changes to the following configuration items:
>
> !Env: INTAKE 45 29
> + !Env: INTAKE 45 28
>
> - !Flash: bootflash: 5356844 Apr 22 17:42:48 2014
> BufferMonitor-1HourData
> + !Flash: bootflash: 5356844 Apr 22 20:42:48 2014
> BufferMonitor-1HourData
>
> Can Rancid be configured to ignore changes in these lines?

Index: bin/nxrancid.in
===================================================================
--- bin/nxrancid.in (revision 2816)
+++ bin/nxrancid.in (working copy)
@@ -313,6 +313,7 @@

s/ +$//; # Drop trailing ' '
next if (/Fan Zone Speed:/);
+ next if (/INTAKE/);
ProcessHistory("COMMENTS","","","!Env: $_");
}
ProcessHistory("COMMENTS","","","!\n");
@@ -436,6 +437,8 @@
return(-1) if (/command authorization failed/i);
return(1) if /(Open device \S+ failed|Error opening \S+:)/;

+ next if (/BufferMonitor-1HourData/);
+
if (/^\s*(\d+) bytes /) {
my($tmp) = int($1 / (1024 * 1024));
s/$1 bytes /$tmp MB /;

lmk if I've misplaced the INTAKE filter.

> I am currently running Rancid 3.0, but had the same issue in 2.3.6 and
> 2.3.8.
_______________________________________________
Rancid-discuss mailing list
Rancid-discuss@shrubbery.net
http://www.shrubbery.net/mailman/listinfo/rancid-discuss
Re: Excluding config lines in Rancid [ In reply to ]
Thanks. The problem with the 3560 was that is was set to cisco-nx instead
of cisco. Once I corrected this the ntp clock-period discrepancy no
longer appeared.

On the Nexus 3548 switch the "BufferMonitor-1HourData" no longer seems to
appear after your changes, but the INTAKE config line still does:

- !Env: INTAKE 45 29
+ !Env: INTAKE 45 28

Here is a snipet from nxrancid with your change for excluding INTAKE:

s/ +$//; # Drop trailing ' '
next if (/Fan Zone Speed:/);
next if (/INTAKE/);
ProcessHistory("COMMENTS","","","!Env: $_");


Thanks again.

--Vincent



From: heasley <heas@shrubbery.net>
To: Vincent Aniello <VAniello@portware.com>
Cc: rancid-discuss@shrubbery.net
Date: 04/24/2014 05:41 PM
Subject: Re: [rancid] Excluding config lines in Rancid



Wed, Apr 23, 2014 at 10:49:49AM -0400, Vincent Aniello:
> Rancid is detecting configuration changes on a few configuration items
in
> Cisco switch configurations that are automatically updated and Rancid
> should exclude from it's comparisons.
>
> On a Cisco Catalyst 3560 switch running software version 12.2(25)SEE4
> Rancid is reporting changes to the "ntp clock-period" command:
>
> - ntp clock-period 36029104
> + ntp clock-period 3602910

this be filtered by stock rancid 3.0. i can not imagine why it would be
missed until the device were not configured as 'cisco'.

> On a Cisco Nexus 3548 switch running software version 6.0(2)A1(1e)
Rancid
> is reporting changes to the following configuration items:
>
> !Env: INTAKE 45 29
> + !Env: INTAKE 45 28
>
> - !Flash: bootflash: 5356844 Apr 22 17:42:48 2014
> BufferMonitor-1HourData
> + !Flash: bootflash: 5356844 Apr 22 20:42:48 2014
> BufferMonitor-1HourData
>
> Can Rancid be configured to ignore changes in these lines?

Index: bin/nxrancid.in
===================================================================
--- bin/nxrancid.in (revision 2816)
+++ bin/nxrancid.in (working copy)
@@ -313,6 +313,7 @@

s/ +$//; # Drop trailing ' '
next if (/Fan Zone Speed:/);
+ next if (/INTAKE/);
ProcessHistory("COMMENTS","","","!Env: $_");
}
ProcessHistory("COMMENTS","","","!\n");
@@ -436,6 +437,8 @@
return(-1) if (/command authorization failed/i);
return(1) if /(Open device \S+ failed|Error opening
\S+:)/;

+ next if (/BufferMonitor-1HourData/);
+
if (/^\s*(\d+) bytes /) {
my($tmp) = int($1 / (1024 * 1024));
s/$1 bytes /$tmp MB /;

lmk if I've misplaced the INTAKE filter.

> I am currently running Rancid 3.0, but had the same issue in 2.3.6 and
> 2.3.8.
Re: Excluding config lines in Rancid [ In reply to ]
Hi,


On Fri, Sep 17, 2021 at 12:28 AM Linux Threads <linuxthreads@gmail.com>
wrote:

> the following does not work for me I am sure the / in AV AI/ML Model is
> the culprit
>
> next if (/AV AI/ML Model:/);
>

Correct, you need to escape quote the center slash in 'AI/ML' with a
backslash as it is also used as the delimiter for the regex. Try this

next if (/AV AI\/ML Model:/);

-andreas
Re: Excluding config lines in Rancid [ In reply to ]
I have this problem also,, but don’t know where to make the update.

Thanks…

Tim

From: Rancid-discuss [mailto:rancid-discuss-bounces@www.shrubbery.net] On Behalf Of Andreas Ott
Sent: Friday, September 17, 2021 1:40 PM
To: linuxthreads@gmail.com
Cc: rancid-discuss@shrubbery.net
Subject: Re: [rancid] Excluding config lines in Rancid

Hi,


On Fri, Sep 17, 2021 at 12:28 AM Linux Threads <linuxthreads@gmail.com<mailto:linuxthreads@gmail.com>> wrote:
the following does not work for me I am sure the / in AV AI/ML Model is
the culprit

next if (/AV AI/ML Model:/);

Correct, you need to escape quote the center slash in 'AI/ML' with a backslash as it is also used as the delimiter for the regex. Try this

next if (/AV AI\/ML Model:/);

-andreas
Re: Excluding config lines in Rancid [ In reply to ]
Hi Rancid Users,

Thank you Andreas! that did the trick,

Tim I am running rancid 3.13, I did edit # fortigate.pm - Fortigate
rancid procedures

under:

if ($filter_osc >= 2) {
...
...
...
...
...
...
next if (/^\s*Virus-DB: .*/);
next if (/AV AI\/ML Model: .*/);


Regards

Juan

On Fri, 2021-09-17 at 18:57 +0000, Tim McIntire wrote:
> I have this problem also,, but don’t know where to make the update.
>
> Thanks…
>
> Tim
>
> From: Rancid-discuss [mailto:rancid-discuss-bounces@www.shrubbery.net
> ] On Behalf Of Andreas Ott
> Sent: Friday, September 17, 2021 1:40 PM
> To: linuxthreads@gmail.com
> Cc: rancid-discuss@shrubbery.net
> Subject: Re: [rancid] Excluding config lines in Rancid
>
> Hi,
>
>
> On Fri, Sep 17, 2021 at 12:28 AM Linux Threads <
> linuxthreads@gmail.com> wrote:
> > the following does not work for me I am sure the / in AV AI/ML
> > Model is
> > the culprit
> >
> > next if (/AV AI/ML Model:/);
>
>
> Correct, you need to escape quote the center slash in 'AI/ML' with a
> backslash as it is also used as the delimiter for the regex. Try this
>
> next if (/AV AI\/ML Model:/);
>
> -andreas

_______________________________________________
Rancid-discuss mailing list
Rancid-discuss@www.shrubbery.net
https://www.shrubbery.net/mailman/listinfo/rancid-discuss