telnet issue
- From: brightdusk365@xxxxxxxxx
- Date: Sat, 08 Sep 2007 02:07:40 -0000
Using following script to telnet to one of FC switch,
proc telnetLogin {user passwd prompt} {
expect {
timeout
{puts "FAIL\nTelnet attempt for $user timed out\n"
return 1
}
eof
{puts "FAIL\nTelnet login prompt for $user never happened\n"
return 1
}
# this is the case where we conenct with the switch
".*login:$"
}
send "$user\r"
expect "Password:"
send "$passwd\r"
expect $prompt
return "0"
}
#
# main
#
.......
.......
set timeout 60
puts "telneting to switch"
spawn telnet $switch
set sw_spid $spawn_id
sleep 5
# exit since it was not possible to connect to the switch
catch {telnetLogin $suser $spasswd $sprompt} code
if {$code != 0} {
puts "unable to access switch"
exit
}
I am getting the following error message,
"Telnet login prompt for xxxxx never happened"
which is the error message from eof in telnetLogin function.
I am thinking "spawn telnet $switch" is not invoking properly.
I would greatly appreciate your feedback.
Thanks.
.
- Follow-Ups:
- Re: telnet issue
- From: Cameron Laird
- Re: telnet issue
- Prev by Date: Re: Tcl Extension Repository
- Next by Date: Re: Tcl Extension Repository
- Previous by thread: How to get 8.4 tcl/tk head from CVS?
- Next by thread: Re: telnet issue
- Index(es):
Relevant Pages
|
|