[rancid] Rancid not backing up some HP switches but can login to them
Remsik,Robert
Robert.Remsik at colostate.edu
Tue Oct 18 16:35:09 UTC 2016
Okay, with the proper -d and -t flags it writes the files and from there can process some of the commands. But it seems like the .raw file isn't beeing written consistently. Different iterations return different results for 'write term'
Once hlogin is fed a timeout it will login just fine. hrancid (which calls hlogin) seems to be missing a 'hit' on 'write term'.
Looking at the .raw file it seems like the section of code can't find the correct line to start, and/or the .raw file isn't grabbing the data fast enough or the switch is spitting data out faster than expect can handle it. From 3 different .raw captures I'm getting 3 different results. Is there a way to synchronize so expect can grab what it needs to?
.:: Running the command ::.
rancid at truck:~/bin$ hrancid -d x.y.121.146
executing hlogin -t 90 -c"show version;show flash;show system-information;show system information;show module;show stack;show tech transceivers;show config files;show config status;write term" x.y.121.146
PROMPT MATCH: HOSTNAME-121146[#>]
HIT COMMAND:HOSTNAME-121146# show version
In ShowVersion: HOSTNAME-121146# show version
HIT COMMAND:HOSTNAME-121146# show flash
In ShowFlash: HOSTNAME-121146# show flash
HIT COMMAND:HOSTNAME-121146# show system-information
In ShowSystem: HOSTNAME-121146# show system-information
HIT COMMAND:HOSTNAME-121146# show system information
In ShowSystem: HOSTNAME-121146# show system information
HIT COMMAND:HOSTNAME-121146# show module
In ShowModule: HOSTNAME-121146# show module
HIT COMMAND:HOSTNAME-121146# show stack
In ShowStack: HOSTNAME-121146# show stack
HIT COMMAND:HOSTNAME-121146# show tech transceivers
In ShowTransceivers: HOSTNAME-121146# show tech transceivers
HIT COMMAND:HOSTNAME-121146# show config files
In ShowConfigFiles: HOSTNAME-121146# show config files
HIT COMMAND:HOSTNAME-121146# show config status
In ShowConfigStatus: HOSTNAME-121146# show config status
rancid at truck:~/bin$
Adm2201f-121146# show config status
Running configuration is same as the startup configuration.
.:: (1) ::.
HOSTNAME-121146# show config status
Running configuration is same as the startup configuration.
HOSTNAME-121146#timesync sntp
sntp unicast
logging x.y.201.199
logging x.y.111.172
snmp-server community "XXX" Operator
snmp-server community "YYY" Unrestricted
snmp-server host x.y.201.190 "XXX" Not-INFO
.:: (2) ::.
HOSTNAME-121146# show config status
Running configuration is same as the startup configuration.
HOSTNAME-121146#sntp unicast
logging x.y.201.199
logging x.y.111.172
.:: (3) ::.
HOSTNAME-121146#module 6 type J8765B
module 7 type J8765B
interface A24
name "To_XYZ-121142_port_A12"
exit
interface B1
name "SUPERSECRET"
exit
interface B3
name "SUPERSECRET"
exit
ip default-gateway x.y.0.1
sntp server x.y.100.10
timesync sntp
sntp unicast
logging x.y.201.199
logging x.y.111.172
.:: Write Term in hrancid ::.
# This routine processes a "write term"
sub WriteTerm {
print STDERR " In WriteTerm: $_" if ($debug);
while (<INPUT>) {
tr/\015//d;
if (/$prompt\s*(exit|logout)\s*$/i) {
$clean_run=1;
last;
}
last if(/^$prompt/);
return(-1) if (/command authorization failed/i);
# the pager can not be disabled per-session
s/^<-+ More -+>\s*//;
s/^$/;/;
# skip the crap
/^running configuration:/i && next;
# filter out any RCS/CVS tags to avoid confusing local CVS storage
s/\$(Revision|Id):/ $1:/;
/^; (\S+) configuration editor;/i &&
ProcessHistory("COMMENTS","keysort","A0",";Chassis type: $1\n") &&
ProcessHistory("","","",";\n;Running config file:\n$_") &&
next;
(... truncated to try to avoid spamming people further ...)
Robert Remsik
ACNS
Desk Phone: 970 491 7120
Robert.Remsik at colostate.edu
________________________________
From: Doug Hughes <doug.hughes at keystonenap.com>
Sent: Tuesday, October 18, 2016 10:01 AM
To: Remsik,Robert; rancid-discuss at shrubbery.net
Subject: Re: [rancid] Rancid not backing up some HP switches but can login to them
Ok, that makes sense, and I looked through the expect on the second test and it looks reasonable.
What happens if you do:
<from rancid home dir>
bin/rancid -t hp -d -f /opt/rancid-3.4.99/.cloginrc x.y.121.146
(... truncating rest of message due to size limitations ...)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.shrubbery.net/pipermail/rancid-discuss/attachments/20161018/0c2de9e6/attachment.html>
More information about the Rancid-discuss
mailing list