[rancid] Backing up Brocade devices with read-only user
Jethro R Binks
jethro.binks at strath.ac.uk
Tue Jan 8 21:07:39 UTC 2013
On Tue, 8 Jan 2013, Danilo Gouveia wrote:
> 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.
More information about the Rancid-discuss
mailing list