i found the debug flag. here's the output during the loop:<br>(i will try to trace it down in the code and see if i can set a condition for this...)<br><br>r204-sw1><br>expect: does " ^\r\n% Invalid input detected at '^' marker.\r\n\r\nr204-sw1>" (spawn_id exp6) match regular expression "^[^\n\r *]*r204-sw1([^#>\r\n]+)?[#>](\([^)\r\n]+\))?"? no<br>
"The system has unsaved changes"? no<br>"Would you like to save them now"? no<br>"(Profile|Configuration) changes have occurred.*"? no<br>"Do you wish to save your configuration changes"? no<br>
"[\n\r]+"? yes<br>expect: set expect_out(0,string) "\r\n"<br>expect: set expect_out(spawn_id) "exp6"<br>expect: set expect_out(buffer) " ^\r\n"<br>expect: continuing expect<br>
<br>expect: does "% Invalid input detected at '^' marker.\r\n\r\nr204-sw1>" (spawn_id exp6) match regular expression "^[^\n\r *]*r204-sw1([^#>\r\n]+)?[#>](\([^)\r\n]+\))?"? no<br>"The system has unsaved changes"? no<br>
"Would you like to save them now"? no<br>"(Profile|Configuration) changes have occurred.*"? no<br>"Do you wish to save your configuration changes"? no<br>"[\n\r]+"? yes<br>expect: set expect_out(0,string) "\r\n\r\n"<br>
expect: set expect_out(spawn_id) "exp6"<br>expect: set expect_out(buffer) "% Invalid input detected at '^' marker.\r\n\r\n"<br>expect: continuing expect<br><br>expect: does "r204-sw1>" (spawn_id exp6) match regular expression "^[^\n\r *]*r204-sw1([^#>\r\n]+)?[#>](\([^)\r\n]+\))?"? yes<br>
expect: set expect_out(0,string) "r204-sw1>"<br>expect: set expect_out(spawn_id) "exp6"<br>expect: set expect_out(buffer) "r204-sw1>"<br>send: sending "exit\r" to { exp6 human_write: avg_arr=0.400000/0.400000 1/shape=1.428571 min=0.300000 max=5.000000<br>
<br><br>sighandler: handling signal(2)<br>async event handler: Tcl_Eval(exit 130)<br><br><br><br>write() failed to write anything - will sleep(1) and retry...<br>EQX root@itops1a:/usr/local/rancid/bin# <br><br><br><br><br>
<div class="gmail_quote">On Tue, Feb 2, 2010 at 2:40 AM, Brian Lam <span dir="ltr"><<a href="mailto:blam@rockyou.com">blam@rockyou.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br><br><div class="gmail_quote"><div class="im">On Fri, Jan 29, 2010 at 6:00 AM, Martin Barry <span dir="ltr"><<a href="mailto:marty@supine.com" target="_blank">marty@supine.com</a>></span> wrote:<br></div><div class="im">
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
$quoted_author = "Brian Lam" ;<br>
<div>><br>
> The expect / python script /usr/local/rancid/bin/clogin was looping because<br>
> my router doesn't like 'exit' and prefer 'quit'.<br>
<br>
</div>You can either modify the following to match the 'force10' platform (does<br>
the newer one accept quit?)<br>
<br></blockquote></div><div><br><br>the new f10 version accepts 'quit'<br><br><br> </div><div class="im"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
# line 678<br>
if { [ string compare "extreme" "$platform" ] } {<br>
send -h "exit\r"<br>
} else {<br>
send -h "quit\r"<br>
}<br>
<br></blockquote></div><div><br><br><br>my version of rancid is 2.3.2<br><br>per your recommendation, here's the diff:<br><br>EQX root@itops1a:/usr/local/rancid/bin# diff clogin clogin.original <br>662,664c662<br>< if { [ string compare "force10" "$platform" ] } {<br>
< send -h "quit\r"<br>< } elseif { [ string compare "extreme" "$platform" ] } {<br>---<div class="im"><br>> if { [ string compare "extreme" "$platform" ] } {<br>
</div>EQX root@itops1a:/usr/local/rancid/bin# <br>
<br>it's a case of fixing one thing and another breaks...<br><br>it looks like it's not looping anymore but it's not updating any of the f10 switches (the previous working f10 are not updated either). rancid log shows the following for all force10 router:<br>
(maybe because the output is different now, rancid end regex doesn't work anymore?)<br><br>=====================================<br>Getting missed routers: round 1.<br>r103: End of run not found<br>end<br>r103-2: End of run not found<br>
end<br>r205-sw1: End of run not found<br>end <br>ec1: End of run not found<br>end<br>ec2: End of run not found<br>end<br>r304: End of run not found<br>end<br>r304-2: End of run not found<br>end<br>=====================================<br>
<br><br><br> <br></div><div class="im"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>
or you could add a stanza in the next section to catch the error thrown when<br>
sending 'exit' to old force10.<br>
<br></blockquote></div><div><br><br><br>maybe i will target the stanza instead and have better luck. the loop output is below. the first 'exit' works but the 2nd on throws an error '% Invalid input detected at '^' marker.' <br>
<br>could you help point me to the right place where i can write an expect regexp to capture this error and deal with it? many thanks. spend many hr pulling my hair / debugging! :p btw, is their a debug flag that i can set to get more debug outputs?<br>
<br><br><br>(looping output)<br><br> interface vlan 1<br> exit <br><br><br><br>exit <br>end <br><br>r204-sw1#exit<br><br>r204-sw1>exit<br> ^<br>% Invalid input detected at '^' marker.<br><br>r204-sw1>exit<br>
^<br>% Invalid input detected at '^' marker.<br><br>r204-sw1>exit<br> ^<br>% Invalid input detected at '^' marker.<br><br>r204-sw1>exit<br> ^<br><br>(looping...)<br><br><br>
</div><div class="im"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
cheers<br>
Marty<br>
_______________________________________________<br>
Rancid-discuss mailing list<br>
<a href="mailto:Rancid-discuss@shrubbery.net" target="_blank">Rancid-discuss@shrubbery.net</a><br>
<a href="http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss" target="_blank">http://www.shrubbery.net/mailman/listinfo.cgi/rancid-discuss</a><br>
</blockquote></div></div><br><br clear="all"><div><div></div><div class="h5"><br>-- <br>Brian Lam | IT/Operations | Rockyou, Inc. | Phone: 408-425-9801 | AIM: brianclam2<br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Brian Lam | IT/Operations | Rockyou, Inc. | Phone: 408-425-9801 | AIM: brianclam2<br>