Ubuntu :: Can't Spawn Telnet Session In Expect Script
Apr 22, 2010
I am moving my migration forward and am trying to get my expect scripts tested and found one that no longer works. Quite simply, it spawns a telnet session to a router.
#!/usr/bin/expect
set env(TERM) vt100
set timeout 3
set send_human {.1 .3 1 .05 2}
set timeout -1
#
spawn telnet 10.254.3.232
and that's it. The result of the script is that the command to spawn simply shows up on the screen like it is a puts command. On my older openSUSE system, it worked fine. I am running Ubuntu v9.10 desktop, and expect and its libs are patched to the latest rev, expect is 5.43.0.
View 1 Replies
ADVERTISEMENT
Dec 2, 2010
I have a TCL expect script that spawns a telnet session to a Nortel DMS100 to execute some commands. The strange thing is that the response in expect_out is not consistent. It sometimes contains a extra enter or newline. This results in differences in the expect out buffer. Here is a part of the script:
send "time
"
sleep 1
expect -re ">"
[code]...
This command displays the time. The correct output should be (with log_user=1):
>time
Time is 11:44:04
>
But sometimes the output is:
>timeTime is 11:45:04
>
As you can see here the is missing on the command that expect sends , or at least in the echo that is comming back. I use a split command to filter out the response in the expect_out buffer, but this fails when the is missing. Here is a example with the debug enabled:
[code]....
I suspect it has something to do with a slow response of the switch. I tried to send the time command slow and with the send_human but the result is the same. A timeout between the send and expect also doesn't help.
View 1 Replies
View Related
Dec 13, 2010
I am working on an expect script to login into a server and copy few wars across the folders. But when i execute it I am getting the following error:
[exec] loginServer.sh: spawn: not found.
[exec] loginServer.sh: expect: 0403-006 Execute permission denied.
[exec] send: -- unknown
The first line is : #!/usr/bin/expect -f.Is this anything to do with server setting or configuration that doesn't allow spawn??
View 3 Replies
View Related
Apr 21, 2010
my tcl framework give exception - send: spawn id exp1025 not open - while executing command - exp_send "echo $ABC". Though this is very sporadic in nature and frequency of occurrence is very less, but still i need to fix it.
I have following queries
- why does this occur so sporadically?
- how do i fix it?
- what shall i do to avoid such exceptions in future.
Note : The function which runs the exp_send command always spawn a bash whenever it is called.
View 3 Replies
View Related
May 21, 2011
I'm trying to use expect to get data from telnet
Here's my code :
Code:
set equipment [lindex $argv 0]
set trunk [lindex $argv 1]
set fraction [lindex $argv 2]
[Code]....
so in bold letter not send in 1 line, but i want sent it to 1 line
View 2 Replies
View Related
Jul 29, 2010
I have a Thomson TG784 router, where I would like to log in automatically and execute dhcp server lease flush command.
When I log in using telnet, the process is following:
Code:
View 6 Replies
View Related
Apr 12, 2010
hypothetically speaking, can i write a script in which a telnet session is opened and then some more commands are forwarded to that session?
View 4 Replies
View Related
May 6, 2011
find and install EXPECT package in RHEL5 to TELNET servers.
View 2 Replies
View Related
Jan 22, 2010
I need to open a telnet session using a shell script that follows this format:
telnet 10.100.0.1
expect "Password:"
send <password>
[code]....
send "pen" (till the end of lines generated as in |more.... usually we use like 8 space bar buttons after "pen" to generate all)
and I want to redirect the whole generated result of "pen" to results.
View 3 Replies
View Related
Dec 1, 2010
I have just installed a version of 32 bits Lucid LTS on a server box. I would like to setup a VNC service so that I will be able to login to the server with VNC viewer and spawn a gnome-session. I ran the following command:
Code:
apt-get install ubuntu-desktop
apt-get install Xvnc xinetd
I was in front of the server and make sure that I can start a gdm locally. Then, I added Xvnc service to xinetd following the guide here: {URL] I was only using a session, and /etc/xinetd.d/Xvnc is as follow:
Code:
service Xvnc
{
type = UNLISTED
disable = no
socket_type = stream
protocol = tcp
wait = yes
user = root
server = /usr/bin/Xvnc .....
After all, I restart gdm by "/etc/init.d/gdm restart". When I try to start a VNC connection from another machine, I can see Xvnc running successfully. But XDMCP does not run properly and I cannot see a traditional ubuntu login screen. I am sure that port 177 UDP is opening by looking at the output of "netstat -anp".
View 5 Replies
View Related
Apr 25, 2010
I am running Ubuntu 9.04 on a wireless networked host machine. The wireless NIC is usb based. Its running inetd for network based servers (telnet, ftp etc).For some reason telnet, ssh or any application specific connection, hangs for a few seconds and then comes back. This happens after every few minutes. I do not loose any sessions or any data flowing across but it is sort of very annoying.It is a dual boot machine and I have also got Windows XP 64-bit. When am running on windows this does not happen, hence am not sure if it is something to do with the wirless nic or something else
View 2 Replies
View Related
Apr 23, 2011
I have done some tcp stream multiplexer. I'm using it as independent login proxy (user is once authenticated and then switched to hidden device (cisco)). But I need to reset session (no connection) configuration, because cisco supports xterm, ctr-c, etc... Am I able to do? Just restart negotiation? Using IAC codes?
View 2 Replies
View Related
Jun 22, 2011
I am using lxterminal to connect to a telnet session on another *nix box.
After I connect, I always have to enter the command
Code:
export TERM=xterm
is there anyway to automate this?
View 3 Replies
View Related
Oct 22, 2009
I want restrict telnet session to users.
That means the client login one user at a time. not multiple login.
For example:
I want restrict this. How to restrict one user to use multiple login.
View 4 Replies
View Related
Mar 15, 2010
On my ubuntu 9.10 pc i am not running a GUI.
Every thing is run from command line.
How do i start a second telnet session from command line.
Plus can i have 4 telnet session open and move from one to the next and back again.
View 5 Replies
View Related
Feb 22, 2010
where to set the telnet session timeout for the IDLE time in redhat linux.
View 2 Replies
View Related
Mar 28, 2011
I have ubuntu 10.04 & I telnet to windows vista. Even if I create a hidden process [URL].. from batch file . It seems the process gets killed when I end connection at port 23 to host. Maybe , the hidden process created is still child of current telnet session so tree is killed as session ends. Is there a way to keep process running even after telnet session has ended ?
View 6 Replies
View Related
Feb 7, 2010
finally i found the script for telnet automated login session...<<Mod edit: questionable link removed>>
View 4 Replies
View Related
Nov 2, 2010
I'm trying to Use Expect to automate a curl function. basically I don't want to type enter for my script to run. Can anyone point me to a good Expect tutorial?
View 1 Replies
View Related
Jul 27, 2010
I am trying to make a script that can be used to check server load on a remote server and produces sound on our local machine, when server load exceeds a particular limit.1. I want to execute command uptime or uptime | awk '{print$10}'on the remote server and store the result in a variable(say x), and later use it in the bash script.
Bash Part
#!/bin/bash
x=$(/root/Desktop/exp)
[code]...
View 1 Replies
View Related
Jun 16, 2010
I am writing an expect script. At a certain point there is a rule that produces this debugging output:
Code:
expect: does " Address or name of remote host [x.x.x.x]? " (spawn_id exp8) match glob pattern " Address or name of remote host [x.x.x.x]? "? no This just times out When I use -exact for the expect keyword it does work What am I doing wrong? THe first should also match in my opinion because it is equal as well. Even if I remove the I still have the same issue if I try without -exact. I don't understand. I tried removing the but still got the same.
View 5 Replies
View Related
Aug 21, 2010
I have got three computers at my home[A,B,C] ( all connected to each other), now I connect to B from A using telnet( $telnet ip_B) , but when I try to connect to C using this telnet session( telnet > open ip_C) , I get this error, "already connected to xxx". Is it possible to connect A to B and then use that session to connect to C, so that C finds that the request is being asked by B.
View 7 Replies
View Related
Nov 19, 2008
I'am new to expect how do i send function key F12 in an expect script?
View 1 Replies
View Related
Feb 18, 2010
I am trying to find the difference between the above two services. Both are under xinetd and can someone please explain the difference between them (is one more secure than the other one?)
View 1 Replies
View Related
Nov 25, 2010
when i am logged into my server via SSH how can i spawn many ssh terminals? is there a xterm command for this?
View 6 Replies
View Related
Sep 23, 2010
i want to spawn the browser in c programme like qtp & selenium.
View 1 Replies
View Related
May 26, 2010
I have recently upgraded 9.10 to 10.04 through the alternate CD. However, each time when I boot my system, post upgrade, I receive this error: INIT:failed to spawn spreadahead main process: unable to execute: No such file or directory After that it waits for a long time to show the desktop.
View 2 Replies
View Related
Apr 28, 2011
I'm using Ubuntu 10.0.4. I'm running a background process on system startup (Selenium) that needs to launch browsers (e.g. Firefox, Google Chrome). What settings do I need to enable in order to do this? Currently, even if I SSH in as a user, I'm not able to launch a browser and get this error ...
Code:
selenium@selenium-chi:~$ /usr/bin/google-chrome
No protocol specified
(chromium-browser:2156): Gtk-WARNING **: cannot open display: :0.0
View 10 Replies
View Related
Nov 2, 2010
I have been doing this for quite sometime now, yet lately I wonder if this is what everybody does...I have a task that will run for hours. In order to not to interrupt that task when I logoff for the day, I issued the command:
Code:
at now 'sh ~/a-long-task'
Is this what everybody else does?
View 2 Replies
View Related
May 28, 2010
I have a minimal installation of Ubuntu, with lxde-core and some other apps I really use. Sometimes when I start the system, it hangs and nothing else happens. I hit Esc and then I see:Code:init: Failed to spawn rc-sysinit main porcess: Unable to open console: Input/Output error.I get stuck there, and the only thing I can do is to hold the power button, shutdown, boot again, and pray it will boot fine. Sometimes it does, sometimes it doesn't.
View 1 Replies
View Related