[rancid] Ignoring (Boot)Flash Changes (IOS and IOS XE) - Update!

Mark Tinka mark.tinka at seacom.mu
Wed Jul 23 15:29:03 UTC 2014


On Wednesday, July 23, 2014 05:15:35 PM Alan McKinnon wrote:

> I made patches to deal with that exact thing. But, I'm no
> longer employed at the company across the hallway from
> you so I can't look them up right now.

That's too bad :-(...

> I still have
> friends there though and can call in a favour.

Always helps :-).

> While we wait, you can give it a bash ourself, it's real
> easy. You edit the script "rancid", look up the sub
> that's run for "show bootflash" and add a check for the
> stuff to be ignored, something like:
> 
> next if <some regex>

-----

This is what we have:

sub ShowFlash {
    # skip if this is 7000, 7200, 7500, or 12000; else we end up with
    # redundant data from dir /all slot0:
    print STDERR "    In ShowFlash: $_" if ($debug);

    while (<INPUT>) {
        tr/\015//d;
        last if (/^$prompt/);
        next if (/^(\s*|\s*$cmd\s*)$/);
        return(1) if ($type =~ /^(12[40]|7)/);
        return(1) if ($ios eq "XE");
        return(1) if (/^\s*\^\s*$/);
        return(1) if (/Line has invalid autocommand /);
        return(1) if (/(Invalid (input|command) detected|Type help or )/i);
        return(-1) if (/command authorization failed/i);
        # the pager can not be disabled per-session on the PIX
        if (/^(<-+ More -+>)/) {
            my($len) = length($1);
            s/^$1\s{$len}//;
        }

        # Filter dhcp database
        next if (/dhcp_[^. ]*\.txt/);

#       /\s+(multiple-fs|nv_hdr|vlan\.dat)$/ && next;
        /\s+(config.text|private-config.text|multiple-fs|nv_hdr|vlan\.dat)$/ && next;
        ProcessHistory("FLASH","","","!Flash: $_");
    }
    ProcessHistory("","","","!\n");
    return;
}

-----

I hacked it a little, changing:

	/\s+(multiple-fs|nv_hdr|vlan\.dat)$/ && next;

... to:

	/\s+(config.text|private-config.text|multiple-fs|nv_hdr|vlan\.dat)$/ &&

But couldn't get it to work. That tip said to disable
commands that run against checking of the file system,
but that was a couple of RANCID's a go and the script
has changed a great deal.

I can estimate what those commands would be for this tip,
but I'd rather ask here to be sure.

Mark.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://www.shrubbery.net/pipermail/rancid-discuss/attachments/20140723/d46bef8a/attachment.sig>


More information about the Rancid-discuss mailing list