Mailing List Archive

Getting notified on timestamp changes for IOS-XE devices
I have looked at a bunch of similar questions but still have not figured
out how to get rancid to ignore the timestamp diff in IOS-XE devices.

- !Flash: bootflash: -rw- 5242880 May 1 2022 15:02:27 -10:00 ssd
+ !Flash: bootflash: -rw- 5242880 May 2 2022 15:03:10 -10:00 ssd

It seems like it was a recent change, I just updated the IOS-XE devices to
Cisco IOS XE Software, Version 17.03.04

I am, and have been, using the standard cisco template
running rancid 3.13-3

TIA,
Steve
Re: Getting notified on timestamp changes for IOS-XE devices [ In reply to ]
On Mon, May 02, 2022 at 04:38:31PM -1000, Steve O'Brien wrote:
> I have looked at a bunch of similar questions but still have not figured
> out how to get rancid to ignore the timestamp diff in IOS-XE devices.
>
> - !Flash: bootflash: -rw- 5242880 May 1 2022 15:02:27 -10:00 ssd
> + !Flash: bootflash: -rw- 5242880 May 2 2022 15:03:10 -10:00 ssd
>
> It seems like it was a recent change, I just updated the IOS-XE devices to
> Cisco IOS XE Software, Version 17.03.04
>
> I am, and have been, using the standard cisco template
> running rancid 3.13-3

It seems like a neverending losing battle filtering out newly
oscillating command outputs. I wonder if rancid should be enhanced to
make the filter patterns configurable rather than requiring code to be
written and/or have standard filters for dates/times in various formats.

_______________________________________________
Rancid-discuss mailing list
Rancid-discuss@www.shrubbery.net
https://www.shrubbery.net/mailman/listinfo/rancid-discuss
Re: Getting notified on timestamp changes for IOS-XE devices [ In reply to ]
Anyone? Hints, clues, anything?

On Mon, May 2, 2022 at 4:38 PM Steve O'Brien <sobrien@nso.edu> wrote:

> I have looked at a bunch of similar questions but still have not figured
> out how to get rancid to ignore the timestamp diff in IOS-XE devices.
>
> - !Flash: bootflash: -rw- 5242880 May 1 2022 15:02:27 -10:00
> ssd
> + !Flash: bootflash: -rw- 5242880 May 2 2022 15:03:10 -10:00
> ssd
>
> It seems like it was a recent change, I just updated the IOS-XE devices to
> Cisco IOS XE Software, Version 17.03.04
>
> I am, and have been, using the standard cisco template
> running rancid 3.13-3
>
> TIA,
> Steve
>
--


*Steve O'Brien* | Senior Network Administrator

National Solar Observatory

Daniel K. Inouye Solar Telescope Project

22 Ohi’a Ku Street, Pukalani, HI 96768
Re: Getting notified on timestamp changes for IOS-XE devices [ In reply to ]
On 5/5/22, Steve O'Brien <sobrien@nso.edu> wrote:
> Anyone? Hints, clues, anything?

I haven't looked at rancid in a long time, but ios.pm used to have
code to blank out the date for certain files. Look for

if (/(dhcp_[^. ]*\.txt|vlan\.dat|sflog|snooping)/ ||
/(smart-log\/agentlog|syslog)\s*$/) {
# filter frequently changing files (dhcp & vlan database) from flash
# change from:
# 9 660 Jan 15 2011 20:43:54 vlan.dat
# 9 660 Jan 15 2011 20:43:54 +00:00 vlan.dat
# to:
# vlan.dat
# vlan.dat

and copy/adjust for your own use.

Regards
Lee

>
> On Mon, May 2, 2022 at 4:38 PM Steve O'Brien <sobrien@nso.edu> wrote:
>
>> I have looked at a bunch of similar questions but still have not figured
>> out how to get rancid to ignore the timestamp diff in IOS-XE devices.
>>
>> - !Flash: bootflash: -rw- 5242880 May 1 2022 15:02:27 -10:00
>> ssd
>> + !Flash: bootflash: -rw- 5242880 May 2 2022 15:03:10 -10:00
>> ssd
>>
>> It seems like it was a recent change, I just updated the IOS-XE devices
>> to
>> Cisco IOS XE Software, Version 17.03.04
>>
>> I am, and have been, using the standard cisco template
>> running rancid 3.13-3
>>
>> TIA,
>> Steve
>>
> --
>
>
> *Steve O'Brien* | Senior Network Administrator
>
> National Solar Observatory
>
> Daniel K. Inouye Solar Telescope Project
>
> 22 Ohi’a Ku Street, Pukalani, HI 96768
>

_______________________________________________
Rancid-discuss mailing list
Rancid-discuss@www.shrubbery.net
https://www.shrubbery.net/mailman/listinfo/rancid-discuss
Re: Getting notified on timestamp changes for IOS-XE devices [ In reply to ]
I wonder if this should be the default behaviour rather than the exception.
Does anyone really use rancid to track changes to files on their routers?

On Thu, 5 May 2022 at 4:23 PM, Lee <ler762@gmail.com> wrote:

> On 5/5/22, Steve O'Brien <sobrien@nso.edu> wrote:
> > Anyone? Hints, clues, anything?
>
> I haven't looked at rancid in a long time, but ios.pm used to have
> code to blank out the date for certain files. Look for
>
> if (/(dhcp_[^. ]*\.txt|vlan\.dat|sflog|snooping)/ ||
> /(smart-log\/agentlog|syslog)\s*$/) {
> # filter frequently changing files (dhcp & vlan database) from
> flash
> # change from:
> # 9 660 Jan 15 2011 20:43:54 vlan.dat
> # 9 660 Jan 15 2011 20:43:54 +00:00 vlan.dat
> # to:
> # vlan.dat
> # vlan.dat
>
> and copy/adjust for your own use.
>
> Regards
> Lee
>
> >
> > On Mon, May 2, 2022 at 4:38 PM Steve O'Brien <sobrien@nso.edu> wrote:
> >
> >> I have looked at a bunch of similar questions but still have not figured
> >> out how to get rancid to ignore the timestamp diff in IOS-XE devices.
> >>
> >> - !Flash: bootflash: -rw- 5242880 May 1 2022 15:02:27 -10:00
> >> ssd
> >> + !Flash: bootflash: -rw- 5242880 May 2 2022 15:03:10 -10:00
> >> ssd
> >>
> >> It seems like it was a recent change, I just updated the IOS-XE devices
> >> to
> >> Cisco IOS XE Software, Version 17.03.04
> >>
> >> I am, and have been, using the standard cisco template
> >> running rancid 3.13-3
> >>
> >> TIA,
> >> Steve
> >>
> > --
> >
> >
> > *Steve O'Brien* | Senior Network Administrator
> >
> > National Solar Observatory
> >
> > Daniel K. Inouye Solar Telescope Project
> >
> > 22 Ohi’a Ku Street, Pukalani, HI 96768
> >
>
> _______________________________________________
> Rancid-discuss mailing list
> Rancid-discuss@www.shrubbery.net
> https://www.shrubbery.net/mailman/listinfo/rancid-discuss
>
Re: Getting notified on timestamp changes for IOS-XE devices [ In reply to ]
Mon, May 02, 2022 at 11:19:00PM -0400, Chuck Anderson:
> On Mon, May 02, 2022 at 04:38:31PM -1000, Steve O'Brien wrote:
> > I have looked at a bunch of similar questions but still have not figured
> > out how to get rancid to ignore the timestamp diff in IOS-XE devices.
> >
> > - !Flash: bootflash: -rw- 5242880 May 1 2022 15:02:27 -10:00 ssd
> > + !Flash: bootflash: -rw- 5242880 May 2 2022 15:03:10 -10:00 ssd
> >
> > It seems like it was a recent change, I just updated the IOS-XE devices to
> > Cisco IOS XE Software, Version 17.03.04
> >
> > I am, and have been, using the standard cisco template
> > running rancid 3.13-3
>
> It seems like a neverending losing battle filtering out newly
> oscillating command outputs. I wonder if rancid should be enhanced to
> make the filter patterns configurable rather than requiring code to be
> written and/or have standard filters for dates/times in various formats.

What I've been thinking, and has been on my to do list, is that a general
filter mechanism would be useful. Perform this user-defined filtering
before diffing & committing the rancidified config. Rancid would expect
the filter to read from stdin and write to stdout.

in the case of this file timestamp oscillation, a user-definied filter
could remove or reformat the line. That filter could be as simple as
"grep -v 'ssd$'", for example.

welcome comments on this.

_______________________________________________
Rancid-discuss mailing list
Rancid-discuss@www.shrubbery.net
https://www.shrubbery.net/mailman/listinfo/rancid-discuss
Re: Getting notified on timestamp changes for IOS-XE devices [ In reply to ]
Wed, May 04, 2022 at 05:38:54PM -1000, Steve O'Brien:
> Anyone? Hints, clues, anything?
>
> On Mon, May 2, 2022 at 4:38 PM Steve O'Brien <sobrien@nso.edu> wrote:
>
> > I have looked at a bunch of similar questions but still have not figured
> > out how to get rancid to ignore the timestamp diff in IOS-XE devices.
> >
> > - !Flash: bootflash: -rw- 5242880 May 1 2022 15:02:27 -10:00
> > ssd
> > + !Flash: bootflash: -rw- 5242880 May 2 2022 15:03:10 -10:00
> > ssd
> >
> > It seems like it was a recent change, I just updated the IOS-XE devices to
> > Cisco IOS XE Software, Version 17.03.04
> >
> > I am, and have been, using the standard cisco template
> > running rancid 3.13-3
> >
> > TIA,
> > Steve


This ought to filter that timestamp.

diff --git a/lib/ios.pm b/lib/ios.pm
index ecb483e3..525c0175 100644
--- a/lib/ios.pm.in
+++ b/lib/ios.pm.in
@@ -1230,7 +1230,7 @@ sub DirSlotN {
# to:
# -rw- vlan.dat
# -rw- vlan.dat
- if (/(dhcp_[^. ]*\.txt|vlan\.dat|\slog|sflog|snooping|syslog)\s*$/ ||
+ if (/(dhcp_[^. ]*\.txt|vlan\.dat|\slog|sflog|snooping|syslog|ssd)\s*$/ ||
/(tracelogs|throughput_monitor_params|underlying-config)\s*$/) {
if (/(\s*\d+\s+)(\S+\s+)(\d+)(\s+)(\w+ \d+\s+\d+ \d+:\d+:\d+ .\d+:\d+)/) {
my($fn, $a, $sz, $c, $dt, $rem) = ($1, $2, $3, $4, $5, $');

_______________________________________________
Rancid-discuss mailing list
Rancid-discuss@www.shrubbery.net
https://www.shrubbery.net/mailman/listinfo/rancid-discuss
Re: Getting notified on timestamp changes for IOS-XE devices [ In reply to ]
Thu, May 05, 2022 at 04:37:20PM +1200, Daniel Kerse:
> I wonder if this should be the default behaviour rather than the exception.
> Does anyone really use rancid to track changes to files on their routers?

If what should be the default? I'm not sure that I understand; please explain.

_______________________________________________
Rancid-discuss mailing list
Rancid-discuss@www.shrubbery.net
https://www.shrubbery.net/mailman/listinfo/rancid-discuss
Re: Getting notified on timestamp changes for IOS-XE devices [ In reply to ]
Thank you, it's been a while since I have used patch but I can't seem to
get it to run without error.
patch < ios.pm.patch
patching file ios.pm
Hunk #1 FAILED at 1230.
1 out of 1 hunk FAILED -- saving rejects to file ios.pm.rej

patching file ios.pm
Hunk #1 FAILED at 1230.
1 out of 1 hunk FAILED -- saving rejects to file ios.pm.rej

more ios.pm.rej
--- ios.pm
+++ ios.pm.new
@@ -1230,7 +1230,7 @@
# to:
# -rw- vlan.dat
# -rw- vlan.dat
- if (/(dhcp_[^. ]*\.txt|vlan\.dat|\slog|sflog|snooping|syslog)\s*$/
||
+ if (/(dhcp_[^.
]*\.txt|vlan\.dat|\slog|sflog|snooping|syslog|ssd)\s*$/ ||
/(tracelogs|throughput_monitor_params|underlying-config)\s*$/) {
if (/(\s*\d+\s+)(\S+\s+)(\d+)(\s+)(\w+ \d+\s+\d+ \d+:\d+:\d+
.\d+:\d+)/) {
my($fn, $a, $sz, $c, $dt, $rem) = ($1, $2, $3, $4, $5, $');


*Steve O'Brien* | Senior Network Administrator

National Solar Observatory

Daniel K. Inouye Solar Telescope Project

22 Ohi’a Ku Street, Pukalani, HI 96768


On Thu, May 5, 2022 at 8:00 AM heasley <heas@shrubbery.net> wrote:

> Wed, May 04, 2022 at 05:38:54PM -1000, Steve O'Brien:
> > Anyone? Hints, clues, anything?
> >
> > On Mon, May 2, 2022 at 4:38 PM Steve O'Brien <sobrien@nso.edu> wrote:
> >
> > > I have looked at a bunch of similar questions but still have not
> figured
> > > out how to get rancid to ignore the timestamp diff in IOS-XE devices.
> > >
> > > - !Flash: bootflash: -rw- 5242880 May 1 2022 15:02:27 -10:00
> > > ssd
> > > + !Flash: bootflash: -rw- 5242880 May 2 2022 15:03:10 -10:00
> > > ssd
> > >
> > > It seems like it was a recent change, I just updated the IOS-XE
> devices to
> > > Cisco IOS XE Software, Version 17.03.04
> > >
> > > I am, and have been, using the standard cisco template
> > > running rancid 3.13-3
> > >
> > > TIA,
> > > Steve
>
>
> This ought to filter that timestamp.
>
> diff --git a/lib/ios.pm b/lib/ios.pm
> index ecb483e3..525c0175 100644
> --- a/lib/ios.pm.in
> +++ b/lib/ios.pm.in
> @@ -1230,7 +1230,7 @@ sub DirSlotN {
> # to:
> # -rw- vlan.dat
> # -rw- vlan.dat
> - if (/(dhcp_[^. ]*\.txt|vlan\.dat|\slog|sflog|snooping|syslog)\s*$/
> ||
> + if (/(dhcp_[^.
> ]*\.txt|vlan\.dat|\slog|sflog|snooping|syslog|ssd)\s*$/ ||
> /(tracelogs|throughput_monitor_params|underlying-config)\s*$/)
> {
> if (/(\s*\d+\s+)(\S+\s+)(\d+)(\s+)(\w+ \d+\s+\d+ \d+:\d+:\d+
> .\d+:\d+)/) {
> my($fn, $a, $sz, $c, $dt, $rem) = ($1, $2, $3, $4, $5, $');
>
>