Discussion:
[rancid] rancid : how to filter clogin -x or -c outcome
alligator94
2015-04-19 07:35:30 UTC
Permalink
Hi,



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 reports to.



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 :

"Invalid"

"Error"

"timeout"



If some of them are trapped during the clogin run, then they could be stored
in a file $hostname_date_time.err.log



Maybe there is an easy way to do it but I am not skilled with expect.

Any help or comment is welcomed.



Thanks

Regards,

Gilles
heasley
2015-04-20 16:12:54 UTC
Permalink
Post by alligator94
Hi,
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 reports to.
Would par(1) help?
Post by alligator94
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.
"Invalid"
"Error"
"timeout"
extracted from the rest of the o/p in what manner?
Post by alligator94
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).
Post by alligator94
Maybe there is an easy way to do it but I am not skilled with expect.
Any help or comment is welcomed.
Thanks
Regards,
Gilles
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo/rancid-discuss
alligator94
2015-04-23 08:20:21 UTC
Permalink
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
created(par.log....)
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.

Regards,
Gilles

-----Original Message-----
From: heasley [mailto:***@shrubbery.net]
Sent: lundi 20 avril 2015 18:13
To: alligator94
Cc: rancid-***@shrubbery.net
Subject: Re: [rancid] rancid : how to filter clogin -x or -c outcome
Post by alligator94
Hi,
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
reports to.

Would par(1) help?
Post by alligator94
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.
"Invalid"
"Error"
"timeout"
extracted from the rest of the o/p in what manner?
Post by alligator94
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).
Post by alligator94
Maybe there is an easy way to do it but I am not skilled with expect.
Any help or comment is welcomed.
Thanks
Regards,
Gilles
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo/rancid-discuss
'heasley'
2016-02-02 01:49:14 UTC
Permalink
Post by alligator94
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
created(par.log....)
I have tried different combinations without success.
I had a bug in quote handling. Please try
ftp://ftp.shrubbery.net/pub/rancid/alpa/rancid-3.2.99.tar.gz which will
likely be rancid 3.3 very soon.

[sorry that it took so long to look into this problem.]
Post by alligator94
I have not found any sample except the one coming with the man page which
doesn't help me.
Regards,
Gilles
-----Original Message-----
Sent: lundi 20 avril 2015 18:13
To: alligator94
Subject: Re: [rancid] rancid : how to filter clogin -x or -c outcome
Post by alligator94
Hi,
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
reports to.
Would par(1) help?
Post by alligator94
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.
"Invalid"
"Error"
"timeout"
extracted from the rest of the o/p in what manner?
Post by alligator94
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).
Post by alligator94
Maybe there is an easy way to do it but I am not skilled with expect.
Any help or comment is welcomed.
Thanks
Regards,
Gilles
_______________________________________________
Rancid-discuss mailing list
http://www.shrubbery.net/mailman/listinfo/rancid-discuss
Loading...