Hi all<br>I try to make rancid working for h3c/3com switches. Therefore I got the appropriate enhancements from <a href="http://sites.google.com/site/jrbinks/code/rancid/h3c">http://sites.google.com/site/jrbinks/code/rancid/h3c</a>. I can login to a switch using h3clogin, no problem. But once expect should figure out the prompt it hangs. Here is an example of sending the command "dis device" to a switch called npd0011:<br>
<br>rancid@sksch001:~$ h3clogin -autoenable -t 5 -c "dis device" npd0011<br>npd0011<br>spawn ssh -c 3des -x -l rancid npd0011<br>rancid@npd0011's password: <br><br><npd0011>undo terminal monitor<br>Info: Current terminal monitor is off.<br>
<br><npd0011><br><npd0011><br>Error: TIMEOUT reached<br><br><br>I firstly did some tries using the options autoenable and noenable, without any success. In the expect script h3clogin I noticed this section:<br>
<br><br><br> # we are logged in, now figure out the full prompt<br> send "\r"<br> expect {<br> -re "\[\r\n]+" { exp_continue; }<br># -re "^(.+:)1 $prompt" { # stoopid extreme cmd-line numbers and<br>
# # prompt based on state of config changes,<br># # which may have an * at the beginning.<br># h3c:<br># send_user "% test\r"<br># set junk $expect_out(1,string)<br>
# regsub -all "^\\\* " $expect_out(1,string) {} junk<br># set prompt ".? ?$junk\[0-9]+ $expect_out(2,string)";<br># set platform "extreme"<br>
# }<br> -re "^.+$prompt" { set junk $expect_out(0,string);<br> regsub -all "\[\]\[]" $junk {\\&} prompt;<br> }<br>
-re "^.+> \\\(enable\\\)" {<br> set junk $expect_out(0,string);<br> regsub -all "\[\]\[]" $junk {\\&} prompt;<br> }<br>
}<br><br><br>I used to use expect in the past but this is far away...from my understanding we send a \r and as a next step we try to determine the prompt, which obviously failes. Any ideas?<br><br>Rgs, Stefan<br>