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 &quot;dis device&quot; to a switch called npd0011:<br>
<br>rancid@sksch001:~$ h3clogin -autoenable -t 5 -c &quot;dis device&quot; npd0011<br>npd0011<br>spawn ssh -c 3des -x -l rancid npd0011<br>rancid@npd0011&#39;s password: <br><br>&lt;npd0011&gt;undo terminal monitor<br>Info: Current terminal monitor is off.<br>
<br>&lt;npd0011&gt;<br>&lt;npd0011&gt;<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 &quot;\r&quot;<br>    expect {<br>        -re &quot;\[\r\n]+&quot;          { exp_continue; }<br>#       -re &quot;^(.+:)1 $prompt&quot;   { # 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 &quot;% test\r&quot;<br>#                                 set junk $expect_out(1,string)<br>
#                                 regsub -all &quot;^\\\* &quot; $expect_out(1,string) {} junk<br>#                                 set prompt &quot;.? ?$junk\[0-9]+ $expect_out(2,string)&quot;;<br>#                                 set platform &quot;extreme&quot;<br>
#                               }<br>        -re &quot;^.+$prompt&quot;        { set junk $expect_out(0,string);<br>                                  regsub -all &quot;\[\]\[]&quot; $junk {\\&amp;} prompt;<br>                                }<br>
        -re &quot;^.+&gt; \\\(enable\\\)&quot;       {<br>                                  set junk $expect_out(0,string);<br>                                  regsub -all &quot;\[\]\[]&quot; $junk {\\&amp;} 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>