jeremys | 1 Mar 2009 18:06

[rancid] Re: Setting up a new command to run on Cisco devices

Look in a perl program named 'rancid'.  The %commands and  <at> commands
variables are what you're looking for.

On 02/27/09, "Steve D. Ousley" <Steve <at> host-it.co.uk> said:
> 
>    Hi all
> 
> 
>    Stupid  question, and I'm sure someone will tell me in no time at all,
>    but  where  is  the  option  that  lists  commands  to be run on given
>    devices?  I'm  trying to set up our cisco devices to run an additional
>    command:  "sh  vlan  brief"  but  cannot for the life of me figure out
>    where the commands are stored.
> 
> 
>    Cheers.
> 
> 
>    Steve Ousley - SO620-RIPE
> 
>    Nuco Technologies Ltd
> 
>    [1]steve <at> host-it.co.uk
> 
>    [2]www.nucotechnologies.com
> 
>    Tel. 0870 165 1300
> 
> 
>    Nuco Technologies Ltd is a company registered in England and Wales
(Continue reading)

Mr. James W. Laferriere | 2 Mar 2009 18:36
Gravatar

[rancid] Patch for hlogin that covers hp-routers as well .

 	Hello John or whoever is the maintainer of hlogin ,
 	Would you please apply this patch to hlogin.in as without it the 
sessions will fail to continue when a "--MORE--" pager is shown .
 		Tia ,  JimL
ps:	John just following your request to just add the necessary command 
rather than programatically determining which to use .

diff -u /home/archive/rancid-2.3.2a9/bin/hlogin.in /usr/local/rancid/bin/hlogin
--- /home/archive/rancid-2.3.2a9/bin/hlogin.in  2008-11-11 16:02:12.000000000 -0900
+++ /usr/local/rancid/bin/hlogin        2009-03-02 08:28:27.000000000 -0900

 <at>  <at>  -505,6 +505,7  <at>  <at> 

      # Turn off the pager and escape regex meta characters in the $prompt
      send "no page\r"
+    send "terminal length 0\r"
      regsub -all {[)(]} $prompt {\\&} reprompt
      regsub -all {^(.{1,11}).*([#>])$} $reprompt {\1([^#>\r\n]+)?[#>](\\([^)\\r\\n]+\\))?} reprompt
      expect {

--

-- 
+------------------------------------------------------------------+
| James   W.   Laferriere | System    Techniques | Give me VMS     |
| Network&System Engineer | 2133    McCullam Ave |  Give me Linux  |
| babydr <at> baby-dragons.com | Fairbanks, AK. 99701 |   only  on  AXP |
+------------------------------------------------------------------+
_______________________________________________
Rancid-discuss mailing list
Rancid-discuss <at> shrubbery.net
http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss
(Continue reading)

john heasley | 2 Mar 2009 19:44

[rancid] Re: How do i downgrade from 2.3.2a9 to 2.3.2a8

Fri, Feb 27, 2009 at 01:15:48PM -0500, Mina Eskander:
> So it looks like the problem is with the regular expression matching, can anybody help me as to why and how to
fix it?
> Here is where it fails, it doesn't know it is in enable mode
> 
> expect: does "<switch>> (enable) " (spawn_id exp6) match regular expression "<switch>>
\\(enable\\)"? no

\\(enable\\)

the double \s are wrong, those should be single \s, escaping the ()s.  I
believe i broke it trying to deal with CSR's funky prompts.

would you try the attached patch?
Index: clogin.in
===================================================================
RCS file: /home/rancid/.CVS/rancid/bin/clogin.in,v
retrieving revision 1.130
diff -d -u -r1.130 clogin.in
--- clogin.in	26 Feb 2009 19:31:24 -0000	1.130
+++ clogin.in	2 Mar 2009 18:43:12 -0000
 <at>  <at>  -572,7 +572,7  <at>  <at> 
 	-re "$u_prompt"	{ send -- "$enauser\r"; exp_continue}
 	-re "$e_prompt"	{ send -- "$enapasswd\r"; exp_continue}
 	"#"		{ set prompt "#" }
-	"(enable)"	{ set prompt "> (enable) " }
+	"(enable)"	{ set prompt "> \(enable\) " }
 	-re "(denied|Sorry|Incorrect)"	{
(Continue reading)

Mina Eskander | 2 Mar 2009 19:46

[rancid] Re: How do i downgrade from 2.3.2a9 to 2.3.2a8

How do I do install the patch? Just replace those files?

Mina Eskander
Perimeterwatch Technologies
Direct:   +1 (347) 448-2845
Mobile:   +1 (347) 510-4102
meskander <at> perimeterwatch.com

Network Security | Disaster Recovery | Business Continuity | IT Projects | Application Development
_____________________________________________________________________
New York: (347) 448-2845 - 34-12 36th Street - 2nd Floor - Astoria, NY 11106

-----Original Message-----
From: john heasley [mailto:heas <at> shrubbery.net]
Sent: Monday, March 02, 2009 1:45 PM
To: Mina Eskander
Cc: john heasley; Lance Vermilion; rancid-discuss <at> shrubbery.net
Subject: Re: [rancid] Re: How do i downgrade from 2.3.2a9 to 2.3.2a8

Fri, Feb 27, 2009 at 01:15:48PM -0500, Mina Eskander:
> So it looks like the problem is with the regular expression matching, can anybody help me as to why and how to
fix it?
> Here is where it fails, it doesn't know it is in enable mode
>
> expect: does "<switch>> (enable) " (spawn_id exp6) match regular
> expression "<switch>> \\(enable\\)"? no

\\(enable\\)

the double \s are wrong, those should be single \s, escaping the ()s.  I believe i broke it trying to deal with
(Continue reading)

john heasley | 2 Mar 2009 23:59

[rancid] Re: Patch for hlogin that covers hp-routers as well .

Mon, Mar 02, 2009 at 08:36:01AM -0900, Mr. James W. Laferriere:
>  	Hello John or whoever is the maintainer of hlogin ,
>  	Would you please apply this patch to hlogin.in as without it the 
> sessions will fail to continue when a "--MORE--" pager is shown .

What HP routers?  Are they actually Foundry OEMs?

>  		Tia ,  JimL
> ps:	John just following your request to just add the necessary command 
> rather than programatically determining which to use .
> 
> 
> diff -u /home/archive/rancid-2.3.2a9/bin/hlogin.in /usr/local/rancid/bin/hlogin
> --- /home/archive/rancid-2.3.2a9/bin/hlogin.in  2008-11-11 16:02:12.000000000 -0900
> +++ /usr/local/rancid/bin/hlogin        2009-03-02 08:28:27.000000000 -0900
> 
>  <at>  <at>  -505,6 +505,7  <at>  <at> 
> 
>       # Turn off the pager and escape regex meta characters in the $prompt
>       send "no page\r"
> +    send "terminal length 0\r"
>       regsub -all {[)(]} $prompt {\\&} reprompt
>       regsub -all {^(.{1,11}).*([#>])$} $reprompt {\1([^#>\r\n]+)?[#>](\\([^)\\r\\n]+\\))?} reprompt
>       expect {
> 
> -- 
> +------------------------------------------------------------------+
> | James   W.   Laferriere | System    Techniques | Give me VMS     |
> | Network&System Engineer | 2133    McCullam Ave |  Give me Linux  |
> | babydr <at> baby-dragons.com | Fairbanks, AK. 99701 |   only  on  AXP |
(Continue reading)

Mr. James W. Laferriere | 3 Mar 2009 02:45
Gravatar

[rancid] Re: Patch for hlogin that covers hp-routers as well .

On Mon, 2 Mar 2009, john heasley wrote:
> Mon, Mar 02, 2009 at 08:36:01AM -0900, Mr. James W. Laferriere:
>>  	Hello John or whoever is the maintainer of hlogin ,
>>  	Would you please apply this patch to hlogin.in as without it the
>> sessions will fail to continue when a "--MORE--" pager is shown .
>
> What HP routers?  Are they actually Foundry OEMs?
>
>>  		Tia ,  JimL
>> ps:	John just following your request to just add the necessary command
>> rather than programatically determining which to use .

 		Hth ,  JimL
#sh ver
ProCurve Secure Router 7102dl
SROS Version: J06.06
   Checksum: 715D204B, built on: Wed Feb 07 09:32:03 2007
Boot ROM version J06.06
   Checksum: C50D, built on: Wed Feb 07 09:32:23 2007
Copyright (c) 2007-2005, Hewlett-Packard, Co.
Platform: ProCurve Secure Router 7102dl
Serial number US507TR005
Flash: 33554432 bytes  DRAM: 134217727 bytes

System uptime is 20 weeks, 1 days, 3 hours, 29 minutes, 52 seconds

Current system image:          "J06_06.biz"
Current configuration-file:    "startup-config"
Configured system image path:
Primary:                       "J06_06.biz"
(Continue reading)

Atif.SIDDIQUI | 3 Mar 2009 15:59

[rancid] Foundry Login


I am having trouble with backing up Foundry devices.

Here is what I have in the .cloginrc file:

add user       n08w              ranciduser
add password   n08w              password
add enauser    n08w              ranciduser
add password   n08w              password 
add method     n08w              ssh   telnet

In the logs it says flogin : TIMEOUT? Can anyone assist here.

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

Regis A. Despres | 3 Mar 2009 17:14

[rancid] Procurve hlogin "show lldp expect"


Hi,

I'm facing a strange behavior trying to get "show lldp info remote-device" from a procurve J4904A.
telnet and ssh hlogin expect script both hangs after giving those infos.
It appears to see an unwanted space just in front the hostname. I don't really have a clue if that is why that hangs.
If someone have a idea ... =)

 
i.e.:

###################################################################################
shell> hlogin -c "sh lld info rem" IP

[snip]
 LLDP Remote Devices Information

  LocalPort | ChassisId                 PortId PortDescr SysName
  --------- + ------------------------- ------ --------- ----------------------
 hostname01#
[hang]
###################################################################################

here is the debug output:

###################################################################################
[snip]
expect: does "  --------- + ------------------------- ------ --------- ----------------------\r\n\r
" (spawn_id exp4) match regular expression "^[^\n\r
*]*hostname0([^#>\r\n]+)?[#>](\([^)\r\n]+\))?"? no
(Continue reading)

john heasley | 3 Mar 2009 20:30

[rancid] Re: Procurve hlogin "show lldp expect"

Tue, Mar 03, 2009 at 05:14:34PM +0100, Regis A. Despres:
> 
> Hi,
> 
> I'm facing a strange behavior trying to get "show lldp info remote-device" from a procurve J4904A.
> telnet and ssh hlogin expect script both hangs after giving those infos.
> It appears to see an unwanted space just in front the hostname. I don't really have a clue if that is why that hangs.
> If someone have a idea ... =)

It really shouldn't be continuing there.  Could you try the attached patch?
Index: hlogin.in
===================================================================
RCS file: /home/rancid/.CVS/rancid/bin/hlogin.in,v
retrieving revision 1.58
diff -d -u -r1.58 hlogin.in
--- hlogin.in	12 Nov 2008 00:59:04 -0000	1.58
+++ hlogin.in	3 Mar 2009 19:01:30 -0000
 <at>  <at>  -522,8 +522,7  <at>  <at> 
 	send -- "[subst -nocommands [lindex $commands $i]]\r"
 	expect {
 	    -re "^\[^\n\r *]*$reprompt"	{ catch {send_user -- "$expect_out(buffer)"} }
-	    -re "^\[^\n\r]*$reprompt."	{ catch {send_user -- "$expect_out(buffer)"}
-					  exp_continue }
+	    -re "^\[^\n\r]*$reprompt "	{ catch {send_user -- "$expect_out(buffer)"} }
 	    -re "\[\n\r]+"		{ catch {send_user -- "$expect_out(buffer)"}
 					  exp_continue }
 	    -re "\[^\r\n]*Press <SPACE> to cont\[^\r\n]*"	{
(Continue reading)

Mina Eskander | 3 Mar 2009 21:53

[rancid] Re: How do i downgrade from 2.3.2a9 to 2.3.2a8

I changed to the directory where clogin is located /usr/local/rancid/bin
And ran the following command:
patch -b -p0 < clogin.in.diff

here is the output

[root <at> pwsecLX bin]# patch -b -p0 < clogin.in.diff
patching file clogin.in
Reversed (or previously applied) patch detected!  Assume -R? [n]
Apply anyway? [n] y
Hunk #1 FAILED at 572.
Hunk #2 FAILED at 611.
Hunk #3 FAILED at 852.
3 out of 3 hunks FAILED -- saving rejects to file clogin.in.rej

Did I do something wrong?

Mina Eskander
Perimeterwatch Technologies
Direct:   +1 (347) 448-2845
Mobile:   +1 (347) 510-4102
meskander <at> perimeterwatch.com

Network Security | Disaster Recovery | Business Continuity | IT Projects | Application Development
_____________________________________________________________________
New York: (347) 448-2845 - 34-12 36th Street - 2nd Floor - Astoria, NY 11106

-----Original Message-----
From: rancid-discuss-bounces <at> shrubbery.net [mailto:rancid-discuss-bounces <at> shrubbery.net] On
Behalf Of Mina Eskander
(Continue reading)


Gmane