Discussion:
[rancid] End of config in Extreme Switches
Aleksey P
2013-10-01 12:08:34 UTC
Permalink
Hello to all.
we use rancid 2.3.4 with Extreme Summit X670 and X650 with XOS 15.3.2.11.
I know that in Extreme swithes there no "End of configuration file" string.
To fix this I changed "xrancid" file:

- if (/^# End of configuration file/i) {

- printf STDERR " End WriteTerm: $_" if ($debug);

- $found_end = 1;

- return(0);

- }

for

+ if (/^# Module vrrp configuration./i) {

+ printf STDERR " End WriteTerm: $_" if ($debug);

+ $found_end = 1;

+ return(0);

+ }

So rancid found vrrp config and then exit.
But now we use "mlag" on Extreme and its config below vrrp. So rancid exit
before this config and we have some missed config lines.
I tried rancid 2.3.8 (clean install on other server), with all default
config files, but only see
"...configuration appears to be truncated.
...missed cmd(s): show configuration"
in logs.

Help me please.
Aleksey P
2013-10-01 12:26:04 UTC
Permalink
In 2.3.8 forgot to comment all commands except "show configuration". Now
in logs only "End of run not found:"
Post by Aleksey P
Hello to all.
we use rancid 2.3.4 with Extreme Summit X670 and X650 with XOS 15.3.2.11.
I know that in Extreme swithes there no "End of configuration file"
- if (/^# End of configuration file/i) {
- printf STDERR " End WriteTerm: $_" if ($debug);
- $found_end = 1;
- return(0);
- }
for
+ if (/^# Module vrrp configuration./i) {
+ printf STDERR " End WriteTerm: $_" if ($debug);
+ $found_end = 1;
+ return(0);
+ }
So rancid found vrrp config and then exit.
But now we use "mlag" on Extreme and its config below vrrp. So rancid exit
before this config and we have some missed config lines.
I tried rancid 2.3.8 (clean install on other server), with all default
config files, but only see
"...configuration appears to be truncated.
...missed cmd(s): show configuration"
in logs.
Help me please.
Paul Thornton
2013-10-01 12:43:21 UTC
Permalink
This post might be inappropriate. Click to display it.
Aleksey P
2013-10-01 13:03:13 UTC
Permalink
Thanks for the answer. But as I said - after vsm module we have config
lines (different for each switch). Like this:
"#
# Module vsm configuration.
#
create mlag peer "E670-DL-AGG-1"
configure mlag peer "E670-DL-AGG-1" ipaddress <IP> vr VR-Default
enable mlag port 1 peer "E670-DL-AGG-1" id 1
enable mlag port 2 peer "E670-DL-AGG-1" id 2
enable mlag port 3 peer "E670-DL-AGG-1" id 3
enable mlag port 4 peer "E670-DL-AGG-1" id 4
enable mlag port 5 peer "E670-DL-AGG-1" id 5
enable mlag port 6 peer "E670-DL-AGG-1" id 6
enable mlag port 17 peer "E670-DL-AGG-1" id 17
enable mlag port 19 peer "E670-DL-AGG-1" id 19
enable mlag port 20 peer "E670-DL-AGG-1" id 20
enable mlag port 32 peer "E670-DL-AGG-1" id 32
enable mlag port 33 peer "E670-DL-AGG-1" id 33
enable mlag port 34 peer "E670-DL-AGG-1" id 34
enable mlag port 35 peer "E670-DL-AGG-1" id 35
enable mlag port 36 peer "E670-DL-AGG-1" id 36
enable mlag port 38 peer "E670-DL-AGG-1" id 38
enable mlag port 40 peer "E670-DL-AGG-1" id 40
enable mlag port 44 peer "E670-DL-AGG-1" id 44 "

and its very sad that we can't save this config.
Post by Paul Thornton
Hi
I had exactly the same problem, and used the same "solution".
However, due to other Extreme oddities a diff for my current xrancid
against the standard 2.3.8 release is full of debug.
However, the key things I changed to "fix" this (I'm sure others here will
suggest better ways) are in the attached diff. I've removed a load of my
temp debug to tidy it up for you.
Note that I rely on a "# Module XYZ configuration" at the end of the
config as well, and this almost certainly will break if the version on the
switch changes. It is very brittle as well because luckily all of the EXOS
switches we have are X450 series and running the same software but if you
have a number of different switches with different software then I can see
this failing badly.
1) I've bypassed the last if ($prompt) in the main loop going through the
output from the switch.
2) It relies on a 'Module xxx configuration' in some cases to spot the end
of the show conf.
3) Detecting a clean run, I rely on the SSH message "Connection to
myswitch.mydomain closed" message. This has a hard-coded regex which
happens to match all of my switch names; this should probably be the
hostname.
As an emergency get-you-going this may help, but please realise that it
isn't really general case production grade!
Paul.
Post by Aleksey P
Hello to all.
we use rancid 2.3.4 with Extreme Summit X670 and X650 with XOS 15.3.2.11.
I know that in Extreme swithes there no "End of configuration file"
- if (/^# End of configuration file/i) {
- printf STDERR " End WriteTerm: $_" if ($debug);
- $found_end = 1;
- return(0);
- }
for
+ if (/^# Module vrrp configuration./i) {
+ printf STDERR " End WriteTerm: $_" if ($debug);
+ $found_end = 1;
+ return(0);
+ }
So rancid found vrrp config and then exit.
But now we use "mlag" on Extreme and its config below vrrp. So rancid
exit before this config and we have some missed config lines.
I tried rancid 2.3.8 (clean install on other server), with all default
config files, but only see
"...configuration appears to be truncated.
...missed cmd(s): show configuration"
in logs.
Help me please.
______________________________**_________________
Rancid-discuss mailing list
http://www.shrubbery.net/**mailman/listinfo/rancid-**discuss<http://www.shrubbery.net/mailman/listinfo/rancid-discuss>
--
Paul Thornton
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo/rancid-discuss
Alan McKinnon
2013-10-01 14:19:45 UTC
Permalink
Post by Aleksey P
Thanks for the answer. But as I said - after vsm module we have config
"#
# Module vsm configuration.
#
create mlag peer "E670-DL-AGG-1"
configure mlag peer "E670-DL-AGG-1" ipaddress <IP> vr VR-Default
enable mlag port 1 peer "E670-DL-AGG-1" id 1
enable mlag port 2 peer "E670-DL-AGG-1" id 2
enable mlag port 3 peer "E670-DL-AGG-1" id 3
enable mlag port 4 peer "E670-DL-AGG-1" id 4
enable mlag port 5 peer "E670-DL-AGG-1" id 5
enable mlag port 6 peer "E670-DL-AGG-1" id 6
enable mlag port 17 peer "E670-DL-AGG-1" id 17
enable mlag port 19 peer "E670-DL-AGG-1" id 19
enable mlag port 20 peer "E670-DL-AGG-1" id 20
enable mlag port 32 peer "E670-DL-AGG-1" id 32
enable mlag port 33 peer "E670-DL-AGG-1" id 33
enable mlag port 34 peer "E670-DL-AGG-1" id 34
enable mlag port 35 peer "E670-DL-AGG-1" id 35
enable mlag port 36 peer "E670-DL-AGG-1" id 36
enable mlag port 38 peer "E670-DL-AGG-1" id 38
enable mlag port 40 peer "E670-DL-AGG-1" id 40
enable mlag port 44 peer "E670-DL-AGG-1" id 44 "
and its very sad that we can't save this config.
What happens if you revert the code back to as-shipped and let WriteTerm
fall out the end?

It should detect the prompt and carry on from there.

If not, rather spend your efforts writing code that works exactly that
way, rather than deliberately throwing config away.
Post by Aleksey P
Hi
I had exactly the same problem, and used the same "solution".
However, due to other Extreme oddities a diff for my current xrancid
against the standard 2.3.8 release is full of debug.
However, the key things I changed to "fix" this (I'm sure others
here will suggest better ways) are in the attached diff. I've
removed a load of my temp debug to tidy it up for you.
Note that I rely on a "# Module XYZ configuration" at the end of the
config as well, and this almost certainly will break if the version
on the switch changes. It is very brittle as well because luckily
all of the EXOS switches we have are X450 series and running the
same software but if you have a number of different switches with
different software then I can see this failing badly.
1) I've bypassed the last if ($prompt) in the main loop going
through the output from the switch.
2) It relies on a 'Module xxx configuration' in some cases to spot
the end of the show conf.
3) Detecting a clean run, I rely on the SSH message "Connection to
myswitch.mydomain closed" message. This has a hard-coded regex
which happens to match all of my switch names; this should probably
be the hostname.
As an emergency get-you-going this may help, but please realise that
it isn't really general case production grade!
Paul.
Hello to all.
we use rancid 2.3.4 with Extreme Summit X670 and X650 with XOS 15.3.2.11.
I know that in Extreme swithes there no "End of configuration file"
- if (/^# End of configuration file/i) {
- printf STDERR " End WriteTerm: $_" if ($debug);
- $found_end = 1;
- return(0);
- }
for
+ if (/^# Module vrrp configuration./i) {
+ printf STDERR " End WriteTerm: $_" if ($debug);
+ $found_end = 1;
+ return(0);
+ }
So rancid found vrrp config and then exit.
But now we use "mlag" on Extreme and its config below vrrp. So rancid
exit before this config and we have some missed config lines.
I tried rancid 2.3.8 (clean install on other server), with all default
config files, but only see
"...configuration appears to be truncated.
...missed cmd(s): show configuration"
in logs.
Help me please.
_________________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/__mailman/listinfo/rancid-__discuss
<http://www.shrubbery.net/mailman/listinfo/rancid-discuss>
--
Paul Thornton
_______________________________________________
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
Paul Thornton
2013-10-01 14:36:31 UTC
Permalink
Hi Alan,
Post by Alan McKinnon
If not, rather spend your efforts writing code that works exactly that
way, rather than deliberately throwing config away.
I last looked into this a few months ago - but IIRC, if we do that then
found_end didn't get set so that then leads to another issue.

I'm just doing some testing with a standard xrancid applying the various
mods I've made to xrancid in the past months to get a firm idea of what
combination works. It was one of those "Try option A, then add B and C
- ah, it works OK now, I won't touch it" debugging sessions I'm afraid.

It would be useful to properly fix this for everyone using Extreme kit.

Paul.
Alan McKinnon
2013-10-01 15:23:40 UTC
Permalink
Post by Paul Thornton
Hi Alan,
Post by Alan McKinnon
If not, rather spend your efforts writing code that works exactly that
way, rather than deliberately throwing config away.
I last looked into this a few months ago - but IIRC, if we do that then
found_end didn't get set so that then leads to another issue.
I'm just doing some testing with a standard xrancid applying the various
mods I've made to xrancid in the past months to get a firm idea of what
combination works. It was one of those "Try option A, then add B and C
- ah, it works OK now, I won't touch it" debugging sessions I'm afraid.
It would be useful to properly fix this for everyone using Extreme kit.
Sounds much like the ProCurves Ryan and myself are currently battling
with :-)
--
Alan McKinnon
***@gmail.com
heasley
2013-10-01 17:12:55 UTC
Permalink
Post by Paul Thornton
Hi Alan,
Post by Alan McKinnon
If not, rather spend your efforts writing code that works exactly that
way, rather than deliberately throwing config away.
I last looked into this a few months ago - but IIRC, if we do that then
found_end didn't get set so that then leads to another issue.
I'm just doing some testing with a standard xrancid applying the various
mods I've made to xrancid in the past months to get a firm idea of what
combination works. It was one of those "Try option A, then add B and C
- ah, it works OK now, I won't touch it" debugging sessions I'm afraid.
It would be useful to properly fix this for everyone using Extreme kit.
would one or two of you send complete
"clogin -c 'show configuration detail;show configuration'" output to me?
Aleksey P
2013-10-02 07:14:36 UTC
Permalink
Hi to All.
Heasley, I sent to you file with output on email.
Alan, I tried clean install ("as-shipped") of 2.3.8 (with only "show
configuration") and as I wrote - I recieve "End of run not found:"
Post by heasley
Post by Paul Thornton
Hi Alan,
Post by Alan McKinnon
If not, rather spend your efforts writing code that works exactly that
way, rather than deliberately throwing config away.
I last looked into this a few months ago - but IIRC, if we do that then
found_end didn't get set so that then leads to another issue.
I'm just doing some testing with a standard xrancid applying the various
mods I've made to xrancid in the past months to get a firm idea of what
combination works. It was one of those "Try option A, then add B and C
- ah, it works OK now, I won't touch it" debugging sessions I'm afraid.
It would be useful to properly fix this for everyone using Extreme kit.
would one or two of you send complete
"clogin -c 'show configuration detail;show configuration'" output to me?
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo/rancid-discuss
Alan McKinnon
2013-10-02 10:09:54 UTC
Permalink
Post by Aleksey P
Hi to All.
Heasley, I sent to you file with output on email.
Alan, I tried clean install ("as-shipped") of 2.3.8 (with only "show
configuration") and as I wrote - I recieve "End of run not found:"
Regular rancid has this at the end of WriteTerm():

# The ContentEngine lacks a definitive "end of config" marker. If we
# know that it is a CE, SAN, or NXOS and we have seen at least 5 lines
# of write term output, we can be reasonably sure that we got the
config.
if (($type == "CE" || $type == "SAN" || $type == "NXOS" ) &&
$linecnt > 5) {
$found_end = 1;
return(0);
}


To me that's a more sensible approach - you can't include checks for
markers that do not exist in the output.
Post by Aleksey P
Post by Paul Thornton
Hi Alan,
Post by Alan McKinnon
If not, rather spend your efforts writing code that works
exactly that
Post by Paul Thornton
Post by Alan McKinnon
way, rather than deliberately throwing config away.
I last looked into this a few months ago - but IIRC, if we do that
then
Post by Paul Thornton
found_end didn't get set so that then leads to another issue.
I'm just doing some testing with a standard xrancid applying the
various
Post by Paul Thornton
mods I've made to xrancid in the past months to get a firm idea of
what
Post by Paul Thornton
combination works. It was one of those "Try option A, then add B
and C
Post by Paul Thornton
- ah, it works OK now, I won't touch it" debugging sessions I'm
afraid.
Post by Paul Thornton
It would be useful to properly fix this for everyone using Extreme
kit.
would one or two of you send complete
"clogin -c 'show configuration detail;show configuration'" output to me?
_______________________________________________
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
James Andrewartha
2013-10-03 00:52:24 UTC
Permalink
Post by Alan McKinnon
To me that's a more sensible approach - you can't include checks for
markers that do not exist in the output.
The entrancid (Enterasys) I have looks like it matches on the exit
command sent by entlogin itself to set $found_end:

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

while (<INPUT>) {
<snip>
}
if (/exit/) {
$found_end = 1;
$clean_run = 1;
return(1);
}
return(0);
}
--
James Andrewartha
Network & Projects Engineer
Christ Church Grammar School
Claremont, Western Australia
Ph. (08) 9442 1757
Mob. 0424 160 877
Aleksey P
2013-10-03 06:49:05 UTC
Permalink
Hello. And how we can implement it to xrancid?
Post by James Andrewartha
Post by Alan McKinnon
To me that's a more sensible approach - you can't include checks for
markers that do not exist in the output.
The entrancid (Enterasys) I have looks like it matches on the exit
sub ShowConfig {
print STDERR " In ShowConfig: $_" if ($debug);
while (<INPUT>) {
<snip>
}
if (/exit/) {
$found_end = 1;
$clean_run = 1;
return(1);
}
return(0);
}
--
James Andrewartha
Network & Projects Engineer
Christ Church Grammar School
Claremont, Western Australia
Ph. (08) 9442 1757
Mob. 0424 160 877
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo/rancid-discuss
Paul Thornton
2013-10-03 08:13:48 UTC
Permalink
Hi

The issue here is that I've found that EXOS/Extremeware doesn't always
echo that 'exit' back reliably before the connection is closed. Again,
it was a long time ago, but I recall problems relying on that for
found_end and/or clean_run getting set.

I think the most sensible option is to go with Alan's suggestion to
assume all is good if we get at least 5 lines of config.

I've been tied up with other things so far this week, but I want to do
some tests on using both the clean xrancid from 2.3.8 and then xrancid
patched for the 'have 5 lines so ok' test. I hope to do this later
today and will report back.

Paul.
Post by James Andrewartha
Post by Alan McKinnon
To me that's a more sensible approach - you can't include checks for
markers that do not exist in the output.
The entrancid (Enterasys) I have looks like it matches on the exit
sub ShowConfig {
print STDERR " In ShowConfig: $_" if ($debug);
while (<INPUT>) {
<snip>
}
if (/exit/) {
$found_end = 1;
$clean_run = 1;
return(1);
}
return(0);
}
--
Paul Thornton
heasley
2013-10-03 15:41:50 UTC
Permalink
Post by Paul Thornton
Hi
The issue here is that I've found that EXOS/Extremeware doesn't always
echo that 'exit' back reliably before the connection is closed. Again,
it was a long time ago, but I recall problems relying on that for
found_end and/or clean_run getting set.
for starters, the main loop also expects to see the exit.
Post by Paul Thornton
I think the most sensible option is to go with Alan's suggestion to
assume all is good if we get at least 5 lines of config.
thats already there, i think, in 2.3.8. of course, it does not deal with
low memory errors like seen on ciscos. another solution might be to add
a \n command and look for the empty prompt line; which is a separate set
of ugliness.
Post by Paul Thornton
I've been tied up with other things so far this week, but I want to do
some tests on using both the clean xrancid from 2.3.8 and then xrancid
patched for the 'have 5 lines so ok' test. I hope to do this later
today and will report back.
Paul.
Post by James Andrewartha
Post by Alan McKinnon
To me that's a more sensible approach - you can't include checks for
markers that do not exist in the output.
The entrancid (Enterasys) I have looks like it matches on the exit
sub ShowConfig {
print STDERR " In ShowConfig: $_" if ($debug);
while (<INPUT>) {
<snip>
}
if (/exit/) {
$found_end = 1;
$clean_run = 1;
return(1);
}
return(0);
}
--
Paul Thornton
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo/rancid-discuss
Loading...