[rancid] show policy detail on extreme switches

Alan McKinnon alan.mckinnon at gmail.com
Wed May 21 22:31:43 UTC 2014

On 21/05/2014 13:18, lexore wrote:
> Hello.
> We use rancid to backup configs of Extreme switches.
> I noticed, that rancid don't save output of "show policy detail".
> We need to backup this too.
> I tried to add support of this command to xrancid.
> I wrote subroutine (copy of WriteTerm), added string to @commandtable,
> but without success.
> Syntax of output "show policy detail" significant differ from usual
> cisco-style configs.
> Is anyone solved this for it's own needs?
> Or maybe you could suggest, how i can add support of this command in xrancid?
> I attached example of ouput "show policy detail" to message.
> Copy here: http://pastebin.com/p6h4bgsE
> We use Extreme Summit X670V
> ExtremeXOS version v1531b4-patch1-29

Indeed, that output looks nothing like anything from a Cisco :-)

When I look over the output your supplied, nothing in there looks like
it might cycle or need to be removed. So that makes life much easier -
all you need is a sub that accepts everything and throws nothing away.
Like this:

1. add to end of @commandtable near line 420:

        {'show policy detail'           => 'ShowPolicy'},

2. A new sub:

# This routine parses "show policy detail"

sub ShowPolicy {
    print STDERR "    In ShowMemory: $_" if ($debug);

    while (<INPUT>) {
        last if(/^$prompt/);
        next if(/^(\s*|\s*$cmd\s*)$/);

	# Any tweaks to individual lines get done here

        # catch anything that wasnt match above.

That's about it. Completely untested so YMMV but the basics are there.
If you do need to tweak individual lines, the existing code is full of
examples. You just need some fegex-fu and it's quite obvious


Alan McKinnon
alan.mckinnon at gmail.com

More information about the Rancid-discuss mailing list