[rancid] show policy detail on extreme switches

lexore lexore at gmail.com
Wed Jun 18 11:34:32 UTC 2014


Thanks, it works!

--
lexore at gmail.com


2014-05-22 2:31 GMT+04:00 Alan McKinnon <alan.mckinnon at gmail.com>:
> 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 15.3.1.4 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>) {
>         tr/\015//d;
>         last if(/^$prompt/);
>         next if(/^(\s*|\s*$cmd\s*)$/);
>
>         # Any tweaks to individual lines get done here
>
>         # catch anything that wasnt match above.
>         ProcessHistory("COMMENTS","keysort","H0","$_");
>
>     }
>     return(0);
> }
>
>
> 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
>
> _______________________________________________
> Rancid-discuss mailing list
> Rancid-discuss at shrubbery.net
> http://www.shrubbery.net/mailman/listinfo/rancid-discuss


More information about the Rancid-discuss mailing list