Discussion:
[rancid] Backing up Brocade devices with read-only user
Tobias Brunner
2013-01-06 14:41:58 UTC
Permalink
Hi,

For backing up some of our Brocade router we created a special SSH user
on this devices for rancid:

username rancid privilege 5 password testpassword
enable read-only-password testpassword

Login with clogin works as expected. But rancid-run will not work. Here
is what the log says:

router1: End of run not found 0 || 0
router1: End of run not found
Error: TIMEOUT reached
router2: End of run not found 0 || 0
router2: End of run not found
Error: TIMEOUT reached
router3: End of run not found 0 || 0
router3: missed cmd(s): show chassis,show module,show flash,show
running-config,write term
router3: End of run not found
!
router4: End of run not found 0 || 0
router4: missed cmd(s): show chassis,show module,show flash,show
running-config,write term
router4: End of run not found
!
router5: End of run not found 0 || 0
router5: missed cmd(s): show chassis,show module,show flash,show
running-config,write term
router5: End of run not found

What does this "End of run not found" mean? Rancid is able to log in
but there seems to be a trouble getting the logs.

Thanks for any help

Cheers,
Tobias
--
Nine Internet Solutions AG, Albisriederstr. 243a, CH-8047 Zuerich
Support +41 44 637 40 40 | Tel +41 44 637 40 00 | Direct +41 44 637 40
13
Skype nine.ch_support
Jethro R Binks
2013-01-06 16:17:16 UTC
Permalink
Post by Tobias Brunner
For backing up some of our Brocade router we created a special SSH user
username rancid privilege 5 password testpassword
If you do this, then you at least also need to do this:

privilege exec level 5 skip-page-display
Post by Tobias Brunner
What does this "End of run not found" mean? Rancid is able to log in but
there seems to be a trouble getting the logs.
It means that it couldn't work out that it had run all the commands and
successfully exited. If the above line doesn't fix your problem, you'll
need to run in debug mode and capture the session output in a .raw file to
investigate where it is going wrong.

I think my flogin/francid are a bit hacked around, so I'd have to compare
to see I have any other specific relevant changes to current releases of
rancid.

Jethro.

. . . . . . . . . . . . . . . . . . . . . . . . .
Jethro R Binks, Network Manager,
Information Services Directorate, University Of Strathclyde, Glasgow, UK

The University of Strathclyde is a charitable body, registered in
Scotland, number SC015263.
Tobias Brunner
2013-01-06 21:32:55 UTC
Permalink
Hi,
Post by Jethro R Binks
privilege exec level 5 skip-page-display
That was it! THANKS a lot...

Cheers,
Tobias
--
Nine Internet Solutions AG, Albisriederstr. 243a, CH-8047 Zuerich
Support +41 44 637 40 40 | Tel +41 44 637 40 00 | Direct +41 44 637 40
13
Skype nine.ch_support
Tobias Brunner
2013-01-08 13:23:33 UTC
Permalink
Hi (once again),

After having the configuration backup running for this Brocade devices, every
rancid-run I get the following diff:

-- configs/router1 (revision 340)
@@ -5,11 +5,11 @@
!NI-X-HSF Switch Fabric Module 1 (Serial #: YYYYYY, Part #: 60-1001588-14)
!FE 1: Type fe600, Version 1
!FE 3: Type fe600, Version 1
- !Switch Fabric Module 1 Up Time is 3 days 4 hours 43 seconds
+ !Switch Fabric Module 1 Up Time is 3 days 11 hours 39 seconds
!NI-X-HSF Switch Fabric Module 2 (Serial #: YYYYYY, Part #: 60-1001588-14)
!FE 1: Type fe600, Version 1
!FE 3: Type fe600, Version 1
- !Switch Fabric Module 2 Up Time is 3 days 4 hours 43 seconds
+ !Switch Fabric Module 2 Up Time is 3 days 11 hours 39 seconds

How can I exclude these lines from the diff?

Cheers,
Tobias
--
Nine Internet Solutions AG, Albisriederstr. 243a, CH-8047 Zuerich
Support +41 44 637 40 40 | Tel +41 44 637 40 00 | Direct +41 44 637 40 13
Skype nine.ch_support
Jethro R Binks
2013-01-08 13:29:25 UTC
Permalink
Post by Tobias Brunner
Hi (once again),
Hi (once again),

In my francid, I have the following lines in the ShowVersion function.
Again it is hacked around so not sure how it compares to what you have,
but you will see it resolves this problem for you:

while (<INPUT>) {
tr/\015//d;
next if /^\s*$/;
last if (/^$prompt/);

next if (/^(The system |Crash time)/);
next if (/^(System|(Active|Standby) Management|LP Slot \d+) uptime is/);

# This line appears somewhere between Netiron 5.1 and 5.3
next if (/^(Switch Fabric Module \d+ Up Time)/);

# remove uptime on newer switches
# but retain the stackid itself
s/(STACKID \d+)\s+system uptime is.*$/$1/;

# See comments at start for more about this flag:
if ( $skip_corrupt_serial ) {
next if (/^\s+Serial #/);
}

s/^\s*(HW|SW)/$1/;
s/^\s*(Compiled on)/SW: $1/;
s/^\s*(\(\d+ bytes\) from )/SW: $1/;

#s/^(HW.*)/$1\n/;
if (/^SL (\d+)/) {
$slot = "Slot $1";
s/^SL \d+/$slot/;
}
if (/MHz .* processor/) {
$slot = "MGMT";
}
s/^(\s*\d+ )/$slot:$1/;
s/^===*//;

ProcessHistory("VERSION","","","!$_");
}

Jethro.
Post by Tobias Brunner
After having the configuration backup running for this Brocade devices, every
-- configs/router1 (revision 340)
@@ -5,11 +5,11 @@
!NI-X-HSF Switch Fabric Module 1 (Serial #: YYYYYY, Part #: 60-1001588-14)
!FE 1: Type fe600, Version 1
!FE 3: Type fe600, Version 1
- !Switch Fabric Module 1 Up Time is 3 days 4 hours 43 seconds
+ !Switch Fabric Module 1 Up Time is 3 days 11 hours 39 seconds
!NI-X-HSF Switch Fabric Module 2 (Serial #: YYYYYY, Part #: 60-1001588-14)
!FE 1: Type fe600, Version 1
!FE 3: Type fe600, Version 1
- !Switch Fabric Module 2 Up Time is 3 days 4 hours 43 seconds
+ !Switch Fabric Module 2 Up Time is 3 days 11 hours 39 seconds
How can I exclude these lines from the diff?
Cheers,
Tobias
--
Nine Internet Solutions AG, Albisriederstr. 243a, CH-8047 Zuerich
Support +41 44 637 40 40 | Tel +41 44 637 40 00 | Direct +41 44 637 40 13
Skype nine.ch_support
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss
. . . . . . . . . . . . . . . . . . . . . . . . .
Jethro R Binks, Network Manager,
Information Services Directorate, University Of Strathclyde, Glasgow, UK

The University of Strathclyde is a charitable body, registered in
Scotland, number SC015263.
Danilo Gouveia
2013-01-08 18:41:18 UTC
Permalink
Is there any specific point in francid that you put this code? I have the
same issue here with the STACKID and I tried to put it in the line 514 and
it's not working.

Thanks

On Tue, Jan 8, 2013 at 11:29 AM, Jethro R Binks
Post by Jethro R Binks
while (<INPUT>) {
tr/\015//d;
next if /^\s*$/;
last if (/^$prompt/);
next if (/^(The system |Crash time)/);
next if (/^(System|(Active|Standby) Management|LP Slot \d+) uptime is/);
# This line appears somewhere between Netiron 5.1 and 5.3
next if (/^(Switch Fabric Module \d+ Up Time)/);
# remove uptime on newer switches
# but retain the stackid itself
s/(STACKID \d+)\s+system uptime is.*$/$1/;
if ( $skip_corrupt_serial ) {
next if (/^\s+Serial #/);
}
s/^\s*(HW|SW)/$1/;
s/^\s*(Compiled on)/SW: $1/;
s/^\s*(\(\d+ bytes\) from )/SW: $1/;
#s/^(HW.*)/$1\n/;
if (/^SL (\d+)/) {
$slot = "Slot $1";
s/^SL \d+/$slot/;
}
if (/MHz .* processor/) {
$slot = "MGMT";
}
s/^(\s*\d+ )/$slot:$1/;
s/^===*//;
ProcessHistory("VERSION","","","!$_");
}
--
Atenciosamente / Best Regards,

Danilo Marques de Gouveia
IT - Network Administrator
55 19 3847 8424
55 19 9160 6441
Jethro R Binks
2013-01-08 21:07:39 UTC
Permalink
Post by Danilo Gouveia
Is there any specific point in francid that you put this code? I have the
same issue here with the STACKID and I tried to put it in the line 514 and
it's not working.
I posted a chunk of my ShowVersion sub, which had an extra bit which might
cause you an issue. Current francid has this one, modified with the
change just discussed. Simply replace your current ShowVersion sub with
this one following.

Jethro.


# This routine parses "show version"
sub ShowVersion {
my($slot);

print STDERR " In ShowVersion: $_" if ($debug);

while (<INPUT>) {
tr/\015//d;
next if /^\s*$/;
last if (/^$prompt/);

next if (/^(The system |Crash time)/);
next if (/^(System|(Active|Standby) Management|LP Slot \d+) uptime is/);
# remove uptime on newer switches
s/(STACKID \d+)\s+system uptime is.*$/$1/;

s/^\s*(HW|SW)/$1/;
s/^\s*(Compiled on)/SW: $1/;
s/^\s*(\(\d+ bytes\) from )/SW: $1/;

#s/^(HW.*)/$1\n/;
if (/^SL (\d+)/) {
$slot = "Slot $1";
s/^SL \d+/$slot/;
}
if (/MHz .* processor/) {
$slot = "MGMT";
}
s/^(\s*\d+ )/$slot:$1/;
s/^===*//;

ProcessHistory("VERSION","","","!$_");
}
ProcessHistory("VERSION","","","!\n");
return(0);
}



. . . . . . . . . . . . . . . . . . . . . . . . .
Jethro R Binks, Network Manager,
Information Services Directorate, University Of Strathclyde, Glasgow, UK

The University of Strathclyde is a charitable body, registered in
Scotland, number SC015263.

Tobias Brunner
2013-01-08 20:35:48 UTC
Permalink
Hi,
Post by Tobias Brunner
After having the configuration backup running for this Brocade
devices, every
-- configs/router1 (revision 340)
@@ -5,11 +5,11 @@
60-1001588-14)
!FE 1: Type fe600, Version 1
!FE 3: Type fe600, Version 1
- !Switch Fabric Module 1 Up Time is 3 days 4 hours 43 seconds
+ !Switch Fabric Module 1 Up Time is 3 days 11 hours 39 seconds
60-1001588-14)
!FE 1: Type fe600, Version 1
!FE 3: Type fe600, Version 1
- !Switch Fabric Module 2 Up Time is 3 days 4 hours 43 seconds
+ !Switch Fabric Module 2 Up Time is 3 days 11 hours 39 seconds
How can I exclude these lines from the diff?
I got a patch from heasley which excludes this lines from the diff:

Index: bin/francid.in
===================================================================
--- bin/francid.in (revision 2658)
+++ bin/francid.in (working copy)
@@ -179,7 +179,7 @@

next if (/^(The system |Crash time)/);
next if (/^(System|(Active|Standby) Management|LP Slot \d+|Switch
Fabric
- Module \d+) uptime is/);
+ Module \d+) (uptime|Up Time) is/);
# remove uptime on newer switches
s/(STACKID \d+)\s+system uptime is.*$/$1/;

Thanks a lot for this great support! I appreciate it...

Cheers,
Tobias
--
Nine Internet Solutions AG, Albisriederstr. 243a, CH-8047 Zuerich
Support +41 44 637 40 40 | Tel +41 44 637 40 00 | Direct +41 44 637 40
13
Skype nine.ch_support
Loading...