Discussion:
[rancid] show policy detail on extreme switches
lexore
2014-05-21 11:18:16 UTC
Permalink
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

Thanks in advance.
Igor.

--
***@gmail.com
Alan McKinnon
2014-05-21 22:31:43 UTC
Permalink
Post by lexore
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.
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
***@gmail.com
lexore
2014-06-18 11:34:32 UTC
Permalink
Thanks, it works!

--
Post by Alan McKinnon
Post by lexore
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.
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.
{'show policy detail' => 'ShowPolicy'},
# 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
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo/rancid-discuss
Alan McKinnon
2014-06-19 14:23:23 UTC
Permalink
Post by lexore
Thanks, it works!
That's good news :-)
[I've had a fortnight from hell, good news is much appreciated!]
Post by lexore
--
Post by Alan McKinnon
Post by lexore
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.
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.
{'show policy detail' => 'ShowPolicy'},
# 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
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo/rancid-discuss
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo/rancid-discuss
--
Alan McKinnon
***@gmail.com
Loading...