Ed,
I am sure you are busy like everyone else. I know you have a very solid
grasp on rancid's files and might be able to offer some insight.
Maybe a "hack" method might be to have clogin do its normal collection
but add "show context" to the commands and then after it evaluates the
output it will login and gather additional information. The addition
information could then be added to the same file that was originally
created.
An Expect approach would be to read a line at a time from "show context"
and do a substring or split on that line and create another array of the
show context commands. I was thinking something like this to capture the
contexts. I basically just created an array out of the lines that were
posted.
set source(0) "cast cast vlan3,164,501,511
disk:/cast.cfg"
set source(1) "university university vlan216,316,416,501,511
disk:/university.cfg"
set source(2) "inspired-broadcast inspired-b vlan217,317,417,501,511
disk:/inspired-broadcast.cfg"
set source(3) "bdex default vlan218,318,418,501,511
disk:/bdex.cfg"
set source(4) "cast-shared-servers cast vlan102,511
disk:/cast-shared-servers.cfg"
set source(5) "alcatel-ipt alcatel-ip vlan511,601,616-626,632
disk:/alcatel-ipt.cfg"
set source(6) "netability netability vlan219,319,419,501,511
disk:/netability.cfg"
set source(7) "etl etl vlan223,323,423,501,511
disk:/etl.cfg"
set source(8) "celeritas celeritas vlan220,320,420,501,511
disk:/celeritas.cfg"
set source(9) "brandsauce brandsauce vlan221,321,421,501,511
disk:/brandsauce.cfg"
set source(10) "eon eon vlan222,322,422,501,511
disk:/eon.cfg"
set source(11) "heat3d neat3d vlan224,324,424,501,511
disk:/neat3d.cfg"
set source(12) "lightwave-technologies lightwave-
vlan225,325,425,501,511 disk:/lightwave-technologies.cfg"
set source(13) "guest-networks guest-netw vlan426,501,504-505,508,511
disk:/guest-networks.cfg"
set source(14) "event-networks event-netw vlan501,506-507,511
disk:/event-networks.cfg"
set source(15) "wag wag vlan226,326,501,511
disk:/wag.cfg"
foreach {key value} [array get source] {
set line [split $value]
set context [lindex $line 0]
puts $context
}
Output:
$/usr/local/bin/expect split.exp
cast
university
inspired-broadcast
bdex
cast-shared-servers
alcatel-ipt
netability
etl
celeritas
brandsauce
eon
heat3d
lightwave-technologies
guest-networks
event-networks
wag
-lance
-------- Original Message --------
Subject: Re: [rancid] Re: Pulling down context configs from a Cisco
FWSM
Date: Tue, March 27, 2007 8:45 am
Post by LanceIn my opinion it shouldn't be too hard. The hardest part would be
looking at the output from "show contexts" and substringing or
delimiting the line via expect and then dynamically changing to each
one and doing the commands needed needed.
The problem is that we're asking the *login scripts to do something
that is outside their model - normally the *rancid scripts send the
list of exact commands to run, the *login scripts run them and put the
output in a file, and then the *rancid scripts parse the output.
There's just no hook for dynamic / interactive commands, or returning
multiple files. You've got the ability to "plugin" an external script,
maybe that would be the place to start, to write a TCL script that can
be called with the "-s" option to clogin, that would deliver the
individual files for each context.
But then we have to get the files into the *rancid program. It
would be nice to do this without some ugly hack, like the ones I
usually code to get around RANCID's limitations.
Post by LanceEd Ravin should be able to code something pretty quick. He has solid
coding skills and should be able to do this in a matter of a few hours
max I would think. That is up to him though.
Thanks for the flowers, but you are being awfully generous with my time!
I have a suspicion that Austin and John are also otherwise engaged.