David Young | 2 May 2010 21:58
Picon

[rancid] Re: Has anybody solved the extreme "unsaved changes" bug?

Hi John,

We are using rancid 2.3.3, with expect 5.43

I believe this is the problem:

I run "xrancid -d myswitch.local":

executing clogin -t 90 -c "show version;show memory;show diag;show
switch;show slot;show configuration detail;show configuration"
myswitch.local

couldn't compile regular expression pattern: quantifier operand invalid
    while executing
"expect -nobrace -re {* myswitch.local([^#>\r\n]+)?[#>](\([^)\r\n]+\))?}
{} -re {[
]+} { exp_continue }"
    invoked from within
"expect {
	    -re $reprompt	{}
	    -re "\[\n\r]+"	{ exp_continue }
	}"
    (procedure "run_commands" line 21)
    invoked from within
"run_commands $prompt $command"
    ("foreach" body line 155)
    invoked from within
"foreach router [lrange $argv $i end] {
    set router [string tolower $router]
    # attempt at platform switching.
(Continue reading)

Diego Ercolani | 3 May 2010 11:47
Picon

[rancid] Re: lrancid / llogin

Hi Pekka,
please subscribe to rancid-discuss to actively partecipate to rancid 
community.

In data lunedì 3 maggio 2010 11:28:44, hai scritto:
> "Hi diego,
> 
> I have installed rancid 2.3.3 on debian (lenny). I wanted to backup a file
> "/home/psuomi/data.cvs" (this is an example) from a remote linux machine.
> I have found your scripts on rancid discussion forum which describs the
> solution of my problem. I have followed your instruction and scripts but
> could not backup the above mention file. I could login to the remote
> machine and getting the below result.
> 
> remlinux:~# export HISTIGNORE="&:cat *:exit*:export *";export LANG=C
> remlinux:~#
> remlinux:~#

do you mean you can issue: llogin remlinux ?
So it should work
Have you configured the .clogin file with something like:

add method remlinux ssh
add user remlinux root
add password remlinux password password
add autoenable remlinux 1
add backupfile remlinux /home/psuomi/data.cvs

(and obviously.... data.cvs must be a FILE not a directory, if you want to 
expand functionality, you should do)
(Continue reading)

Ron Whitney | 3 May 2010 22:21
Favicon

[rancid] Re: lrancid / llogin

I've tried to use the lrancid scripts as well without luck.  Eventually, I gave up.  Pekka's question
prompted me to try again.  Here are my details:

Relevant portion of .clogon:

add method      groucho         {ssh}
add user        groucho         {rwhitney}
add password    groucho         {password}        {password}
add autoenable  groucho         1
add backupfile  groucho         /var/named/p/mydoitbest.com

Added to rancid-fe:

        "linux" => "lrancid llogin",

Finally, router.db:

Groucho:linux:up

When I try to test, it logs on but issues no commands.  Eventually (10 seconds in this case), it times out:

[rancid <at> harpo ~]$ llogin -t 10 -c"BackupFiles" groucho
groucho
spawn ssh -c 3des -x -l rwhitney groucho
rwhitney <at> groucho's password:
Last login: Mon May  3 16:07:33 2010 from 12-162-57-170.doitbest.com
groucho 16:14:19 rwhitney >
Error: TIMEOUT reached

I get similar results testing lrancid:
(Continue reading)

Martin Barry | 4 May 2010 07:56
Gravatar

[rancid] Re: lrancid / llogin

$quoted_author = "Ron Whitney" ;
> 
> When I try to test, it logs on but issues no commands.  Eventually (10 seconds in this case), it times out:
> 
> [rancid <at> harpo ~]$ llogin -t 10 -c"BackupFiles" groucho
> groucho
> spawn ssh -c 3des -x -l rwhitney groucho
> rwhitney <at> groucho's password:
> Last login: Mon May  3 16:07:33 2010 from 12-162-57-170.doitbest.com
> groucho 16:14:19 rwhitney >
> Error: TIMEOUT reached

It's looking for an "enable" prompt and not finding one.

Try with -noenable

cheers
Marty
_______________________________________________
Rancid-discuss mailing list
Rancid-discuss <at> shrubbery.net
http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss

Diego Ercolani | 4 May 2010 09:13
Picon

[rancid] Re: lrancid / llogin

You have to verify that:
1. the user has a regular shell: ssh whitney <at> groucho give you a regular shell?
2. can you read the FILE you are trying to read ? (cat 
/var/named/p/mydoitbest.com)
3. my script waits for the root prompt (#) so the timeout is related to this 
issue. If you want to use a normal user you have to modify the script (llogin) 
to accomplish this....  
I use it in a production environment connecting to root user of debian/suse 
workstations..... so It should work as is.  If you need more functionality you 
should implement it and release to the community.
This is opensource.

Hope This Help
Diego
In data lunedì 3 maggio 2010 22:21:12, Ron Whitney ha scritto:
: > I've tried to use the lrancid scripts as well without luck.  Eventually, I
> gave up.  Pekka's question prompted me to try again.  Here are my details:
> 
> Relevant portion of .clogon:
> 
> add method      groucho         {ssh}
> add user        groucho         {rwhitney}
> add password    groucho         {password}        {password}
> add autoenable  groucho         1
> add backupfile  groucho         /var/named/p/mydoitbest.com
> 
> Added to rancid-fe:
> 
>         "linux" => "lrancid llogin",
> 
(Continue reading)

Ron Whitney | 4 May 2010 22:48
Favicon

[rancid] Re: lrancid / llogin

Thanks for the reply.  I agree, it doesn't like the prompt.  The Linux host in question is a RedHat box.  The
prompts given are as follows:

groucho 16:18:46 rwhitney >			(Regular user)
groucho 16:17:08 SU >				(root user)

(The machine running RANCID is Fedora which has a "[rancid <at> harpo bin]$ " prompt.)

As a test, I made some very crude changes to llogin and got past the prompt issue.  However, I'm now receiving
the following:

[rancid <at> harpo bin]$ lrancid -d groucho
executing llogin -t 90 -c"BackupFiles" groucho
bad option "-nocase": must be -exact, -glob, -regexp, or --
    while executing
"switch -glob -nocase [subst -nocommands [lindex $commands $i]] {
         backupfiles {
           set files [find backupfile $host]
           if { [info exists f..."
    (procedure "run_commands" line 26)
    invoked from within
"run_commands $router $prompt $command"
    ("foreach" body line 151)
    invoked from within
"foreach router [lrange $argv $i end] {
    set router [string tolower $router]
    # attempt at platform switching.
    set platform ""
    send_user ..."
    (file "/usr/local/rancid/bin/llogin" line 789)
(Continue reading)

Mahaffey, Brian | 4 May 2010 23:20
Favicon

[rancid] Re: Error Cannot read "N5"

Upgraded from 2.3.2a9 to 2.3.3 but still running into the same issue. I don’t get any results from htdig L

 

-bash-3.2$ clogin 10.220.52.1

 

Error: can't read "n5": no such variable

 

-bash-3.2$ clogin -V

rancid 2.3.3

 

Doesn’t matter which type of command switches I use with clogin or if I use a device that isn’t defined in the .cloginrc file.  If anyone has an idea shoot it over to me.

 

Thanks!

 

From: rancid-discuss-bounces <at> shrubbery.net [mailto:rancid-discuss-bounces <at> shrubbery.net] On Behalf Of Mahaffey, Brian
Sent: Thursday, April 29, 2010 1:46 PM
To: rancid-discuss <at> shrubbery.net
Subject: [rancid] Error Cannot read "N5"

 

When I run rancid I get the following output

 

-bash-3.2$ clogin b5-m-c6509a.pelco.org

Error: can't read "n5": no such variable

 

Anyone seen this output before?


This transmission is intended only for use by the intended
recipient(s). If you are not an intended recipient you should not read, disclose copy, circulate or in any other way use the information contained in this transmission. The information contained in this transmission may be confidential and/or privileged. If you have received this transmission in error, please notify the sender immediately and delete this transmission including any attachments.


This transmission is intended only for use by the intended
recipient(s). If you are not an intended recipient you should not read, disclose copy, circulate or in any other way use the information contained in this transmission. The information contained in this transmission may be confidential and/or privileged. If you have received this transmission in error, please notify the sender immediately and delete this transmission including any attachments.
_______________________________________________
Rancid-discuss mailing list
Rancid-discuss <at> shrubbery.net
http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss
john heasley | 5 May 2010 07:50

[rancid] Re: Error Cannot read "N5"

Tue, May 04, 2010 at 02:20:46PM -0700, Mahaffey, Brian:
> Upgraded from 2.3.2a9 to 2.3.3 but still running into the same issue. I
> don't get any results from htdig L
> 
>  
> 
> -bash-3.2$ clogin 10.220.52.1
> 
>  
> 
> Error: can't read "n5": no such variable

my guess is that you have a meta-character in your cloginrc that needs to
be escaped.  see cloginrc(5).
_______________________________________________
Rancid-discuss mailing list
Rancid-discuss <at> shrubbery.net
http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss

Diego Ercolani | 5 May 2010 09:14
Picon

[rancid] Re: lrancid / llogin

Uhm.... why don't you use a STANDARD root prompt?
PS1="${HOST}:${PWD} # "
linux machines (also RedHats) with BASH shell have this prompt normally

In data martedì 4 maggio 2010 22:48:06, Ron Whitney ha scritto:
: > Thanks for the reply.  I agree, it doesn't like the prompt.  The Linux 
host
> in question is a RedHat box.  The prompts given are as follows:
> 
> groucho 16:18:46 rwhitney >			(Regular user)
> groucho 16:17:08 SU >				(root user)
> 
> (The machine running RANCID is Fedora which has a "[rancid <at> harpo bin]$ "
> prompt.)
> 
> As a test, I made some very crude changes to llogin and got past the prompt
> issue.  However, I'm now receiving the following:
> 
> [rancid <at> harpo bin]$ lrancid -d groucho
> executing llogin -t 90 -c"BackupFiles" groucho
> bad option "-nocase": must be -exact, -glob, -regexp, or --
>     while executing
> "switch -glob -nocase [subst -nocommands [lindex $commands $i]] {
>          backupfiles {
>            set files [find backupfile $host]
>            if { [info exists f..."
>     (procedure "run_commands" line 26)
>     invoked from within
> "run_commands $router $prompt $command"
>     ("foreach" body line 151)
>     invoked from within
> "foreach router [lrange $argv $i end] {
>     set router [string tolower $router]
>     # attempt at platform switching.
>     set platform ""
>     send_user ..."
>     (file "/usr/local/rancid/bin/llogin" line 789)
> groucho: missed cmd(s): BackupFiles
> groucho: missed cmd(s): BackupFiles
> groucho: End of run not found
> groucho: End of run not found
> #
> 
> I suspect I'm running into differences between flavors of linux (Mine are
> mostly RedHat or Fedora based) which is breaking llogin.  Everything else
> (users, permissions, etc.) check out.  Since my ability to code is
> non-existent, I think I'll abandon this up for now.  Thanks for trying to
> assist.
> 
> Ron
> 
> > -----Original Message-----
> > From: rancid-discuss-bounces <at> shrubbery.net
> > [mailto:rancid-discuss-bounces <at> shrubbery.net] On Behalf Of
> > Diego Ercolani
> > Sent: Tuesday, May 04, 2010 03:14
> > To: rancid-discuss <at> shrubbery.net
> > Subject: [rancid] Re: lrancid / llogin
> > 
> > 
> > You have to verify that:
> > 1. the user has a regular shell: ssh whitney <at> groucho give you
> > a regular shell? 2. can you read the FILE you are trying to
> > read ? (cat
> > /var/named/p/mydoitbest.com)
> > 3. my script waits for the root prompt (#) so the timeout is
> > related to this
> > issue. If you want to use a normal user you have to modify
> > the script (llogin)
> > to accomplish this....
> > I use it in a production environment connecting to root user
> > of debian/suse
> > workstations..... so It should work as is.  If you need more
> > functionality you
> > should implement it and release to the community.
> > This is opensource.
> > 
> > Hope This Help
> > Diego
> > 
> > In data lunedì 3 maggio 2010 22:21:12, Ron Whitney ha scritto:
> > : > I've tried to use the lrancid scripts as well without
> > 
> > luck.  Eventually, I
> > 
> > > gave up.  Pekka's question prompted me to try again.  Here are my
> > > details:
> > > 
> > > Relevant portion of .clogon:
> > > 
> > > add method      groucho         {ssh}
> > > add user        groucho         {rwhitney}
> > > add password    groucho         {password}        {password}
> > > add autoenable  groucho         1
> > > add backupfile  groucho         /var/named/p/mydoitbest.com
> > > 
> > > Added to rancid-fe:
> > >         "linux" => "lrancid llogin",
> > > 
> > > Finally, router.db:
> > > 
> > > Groucho:linux:up
> > > 
> > > When I try to test, it logs on but issues no commands.
> > 
> > Eventually (10
> > 
> > > seconds in this case), it times out:
> > > 
> > > [rancid <at> harpo ~]$ llogin -t 10 -c"BackupFiles" groucho groucho
> > > spawn ssh -c 3des -x -l rwhitney groucho
> > > rwhitney <at> groucho's password:
> > > Last login: Mon May  3 16:07:33 2010 from 12-162-57-170.doitbest.com
> > > groucho 16:14:19 rwhitney >
> > > Error: TIMEOUT reached
> > > 
> > > I get similar results testing lrancid:
> > > 
> > > [rancid <at> harpo ~]$ lrancid -d groucho
> > > executing llogin -t 90 -c"BackupFiles" groucho
> > > groucho llogin error: Error: TIMEOUT reached
> > > groucho llogin error: Error: TIMEOUT reached
> > > groucho: missed cmd(s): BackupFiles
> > > groucho: missed cmd(s): BackupFiles
> > > groucho: End of run not found
> > > groucho: End of run not found
> > > #
> > > 
> > > Can anyone point me in the right direction?  RANCID is working on
> > > several Cisco switches and routers and a couple of Dell
> > 
> > switches.  So
> > 
> > > I know the base functionality is working.  Thanks in advnace.
> > > 
> > > 
> > > Ron
_______________________________________________
Rancid-discuss mailing list
Rancid-discuss <at> shrubbery.net
http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss

Mahaffey, Brian | 5 May 2010 17:27
Favicon

[rancid] Re: Error Cannot read "N5"

That was the issue, something in my .cloginrc file.  I created a new one
and its working. Thanks for the help!

-----Original Message-----
From: john heasley [mailto:heas <at> shrubbery.net] 
Sent: Tuesday, May 04, 2010 10:51 PM
To: Mahaffey, Brian
Cc: rancid-discuss <at> shrubbery.net
Subject: Re: [rancid] Re: Error Cannot read "N5"

Tue, May 04, 2010 at 02:20:46PM -0700, Mahaffey, Brian:
> Upgraded from 2.3.2a9 to 2.3.3 but still running into the same issue.
I
> don't get any results from htdig L
> 
>  
> 
> -bash-3.2$ clogin 10.220.52.1
> 
>  
> 
> Error: can't read "n5": no such variable

my guess is that you have a meta-character in your cloginrc that needs
to
be escaped.  see cloginrc(5).

This transmission is intended only for use by the intended
recipient(s). If you are not an intended recipient you should not read, disclose copy, circulate or in any
other way use the information contained in this transmission. The information contained in this
transmission may be confidential and/or privileged. If you have received this transmission in error,
please notify the sender immediately and delete this transmission including any attachments.
_______________________________________________
Rancid-discuss mailing list
Rancid-discuss <at> shrubbery.net
http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss


Gmane