Discussion:
[rancid] How to config the output of a command to record in a file.
Harlei Lima
2017-01-24 13:47:54 UTC
Permalink
Dear colleagues.

I'm starting with Rancid and I did my frist basic config, but I'm not can
or I'm not understanding how to config the output of a command to record
at file. For exemple a .clogin -c "show version" and record any file.

[image: Imagem inline 2]
[image: Imagem inline 1]
Can Somebody helpe me?

Atenciosamente:
Harlei Julio de Lima
Gerente de Infraestrutura TI | Segurança de Redes e Computadores | Analista
TI Sênior | Pesquisa e Inovação
https://br.linkedin.com/in/hjlima
heasley
2017-01-24 18:11:40 UTC
Permalink
Post by Harlei Lima
Dear colleagues.
I'm starting with Rancid and I did my frist basic config, but I'm not can
or I'm not understanding how to config the output of a command to record
at file. For exemple a .clogin -c "show version" and record any file.
Can Somebody helpe me?
I am not sure that I understand what you are asking.

show version is collected by rancid for all devices. add the device to a
group's router.db and the stored file will have the useful parts of it.
Lee
2017-01-24 18:16:13 UTC
Permalink
Post by Harlei Lima
Dear colleagues.
I'm starting with Rancid and I did my frist basic config, but I'm not can
or I'm not understanding how to config the output of a command to record
at file. For exemple a .clogin -c "show version" and record any file.
If you want to save the output from 'clogin -c ...' here's a snippet
from one of my scripts:

######### commands to run on every switch:
# show interface trunk
# to get all the trunk ports
# but none of the ports that make up a port channel on IOS are
listed, so have to do
# "show etherchannel summary" to completely populate the interface list
#
# show etherchannel summary
# to get the mapping of port-channels => physical ports on IOS switches
# the output seems to ignore "term width" so port channels of 4 or more ports
# are on separate lines
#
# show cdp neighbor
# to find out what is on the other side of the link

clogin -c "show interface trunk;show etherchannel summary;show cdp
neighbor" $DEVLIST | tr -d "\r" |\
awk '/show interface trunk/ , /exit/' > $DATAFILE

### NOTE: the above removes trailing carriage returns as well as login
banner, motd, etc.
### please try to do the same if you're creating the file yourself

fi
###################################################################


Regards,
Lee

Loading...