[rancid] rancid : how to filter clogin -x or -c outcome
alligator94 at laposte.net
Thu Apr 23 08:20:21 UTC 2015
Thanks for the info.
I would need some help as I am unable to make par(1) work.
My tests run on a test system.
In the same directory as clogin, I have created a file named "infile" which
contains the command to run. It contains 2 lines
# ( to indicate that the next one is a command)
clogin -c "show users" hostname
Then I run ./par infile. Nothing happens but 3 empty log files are
I have tried different combinations without success.
I have not found any sample except the one coming with the man page which
doesn't help me.
From: heasley [mailto:heas at shrubbery.net]
Sent: lundi 20 avril 2015 18:13
Cc: rancid-discuss at shrubbery.net
Subject: Re: [rancid] rancid : how to filter clogin -x or -c outcome
Sun, Apr 19, 2015 at 09:35:30AM +0200, alligator94:
> I very often use clogin -x or clogin -c to perform mass configuration
> updates. My concern is that clogin doesn't analyze the outcome of the
> command passed with -x or -d, so there is no easy way to know if the
> command has been successfully accepted by the device . For instance,
> some old cisco ios don't accept some commands.
> I have tried to use the clogin debug (-d) option, but it generates a
> huge amount of lines. I have also tested to open a log file (I am
> using teraterm) before running clogin, then to do a search but, it is
> not really easy because each time that you find an error condition,
> you need to look backward in the file to know which host the error message
Would par(1) help?
> I have also looked at the -s option but it looks complex to me.
> What would be nice to have is a way to pass a file to clogin as a
> parameter which would contain a list of keyword that you want to be
> extracted from the outcome.
> I am thinking to some words like :
extracted from the rest of the o/p in what manner?
> If some of them are trapped during the clogin run, then they could be
> stored in a file $hostname_date_time.err.log
I think par(1) would indeed help you here. you could egrep the stuff you
want to extract (or awk, etc).
> Maybe there is an easy way to do it but I am not skilled with expect.
> Any help or comment is welcomed.
> Rancid-discuss mailing list
> Rancid-discuss at shrubbery.net
More information about the Rancid-discuss