Sponsored Content
Top Forums Shell Programming and Scripting Webpage to Telnet via Perl and Expect: Telnet problem? Post 302217084 by jondo on Tuesday 22nd of July 2008 12:35:09 AM
Old 07-22-2008
(don't mind me...just talking to myself here...)
Fixed problem with finicky Telnet device.
Used Net::Telnet instead of Expect.
When webpage spawned CGI script, this time the Telnet session from Net::Telnet did not send back a NAWS packet to the server,(like Expect did) so the login proceeded normally.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need 'expect' help, ssh/telnet and trapping

So here is what I am trying to do. I have a large # of switches and routers I am trying to log into. Unfortunately some have ssh only, some have telnet only. and some i have never logged into with ssh. I first want it to SSH, if i have never logged into the box it will ask for adding the ssh key. I... (0 Replies)
Discussion started by: ippy98
0 Replies

2. Infrastructure Monitoring

expect telnet unexpected delays

I must automatically monitor and manage a large number of boxes on our network. I have been using perl/Net::Telnet and expect/telnet and also perl/ssh and expect/ssh to reach the command line of the remote boxes. Scripts are working but slow. (Yes, I do use SNMP also but many boxes do not... (2 Replies)
Discussion started by: kp2a
2 Replies

3. Shell Programming and Scripting

Telnet Expect script question

Hi all, I have written a small expect script which should spawn a telnet session login and execute some commands. #!/usr/bin/expect -f spawn telnet $env(IP) match_max 100000 expect "login:" send -- "******\n" expect -exact "Password:" send -- "****\n" expect "%" Now I have got... (2 Replies)
Discussion started by: stinkefisch
2 Replies

4. Shell Programming and Scripting

telnet commands using expect

Hi All, I am trying to write a expect script to telnet and run a command on a remote host.The command i want to send contains a text value is contained in file.txt in the linux box from where i am running the expect script.I want to pass the contains of file.txt into a variable and call the... (1 Reply)
Discussion started by: pistachio
1 Replies

5. Shell Programming and Scripting

Help needed with expect...(If telnet fails)

Hello I'm working using expect to automate telnet commands...i want to check if telnet fails and in this case...certain message should appear or certain word should be out in a file). Thses are the messages that apeear if telnet fails: Trying 172.16.3.115... telnet: Unable to connect... (0 Replies)
Discussion started by: Hossam_Nox
0 Replies

6. Shell Programming and Scripting

Expect script to automate telnet session

Hi all, I am currently running a daemon which creates a virtual terminal for testing purposes. Essentially, if I were to interact with it manually, this is what I get. john@test1:~$telnet localhost 7777 Trying ::1... Connected to localhost. Escape character is '^]' mip6d> pl eth2... (6 Replies)
Discussion started by: abxccd
6 Replies

7. Shell Programming and Scripting

expect: redirect telnet to file

I've got some expect/tcl scripts. Now i want to add a function that allows to open a telnet connection and redirect the output to a logfile. On the shell/terminal i tried something like: 'telnet 192.168.123.123 12121 > /home/user/logging/log-telnet.log' and the telnet is redirected into the... (2 Replies)
Discussion started by: JaPatton
2 Replies

8. Shell Programming and Scripting

Expect/telnet/testing tacacs on a cisco

At times I find the need to test that the tacacs port 49 is open. The code below works but is painfully slow because I have to wait on the timeouts. Examples of possible responds router1#telnet 10.11.20.14 49 Trying 206.112.204.140, 49 ... Open route1#telnet 10.11.19.14 49 Trying... (1 Reply)
Discussion started by: popeye
1 Replies

9. Shell Programming and Scripting

Calling Expect Script - Telnet

Hi All, I have an Expect script which logs into Cisco switch, performs a show interface command. I want to read a file of ip addresses which will be passed to the expect script. The script to read the file works, the expect script works on it's own but when i call the 'expect' script from the... (12 Replies)
Discussion started by: trinak96
12 Replies

10. Shell Programming and Scripting

expect telnet script execute by cronjob

hi, please help, keep getting this bolded error and look it up and people say its your environment variable though i tried to set it manually in expect..it run fine if i run it manually but once i run it by cronjob it error below..i tried to comment out ip/login info with *.. logfile:: START... (0 Replies)
Discussion started by: cssanangeles
0 Replies
fence_baytech(8)					      System Manager's Manual						  fence_baytech(8)

NAME
fence_baytech - I/O Fencing agent for Baytech RPC switches in combination with a Cyclades Terminal Server SYNOPSIS
fence_baytech [OPTION]... DESCRIPTION
This fencing agent is written for the Baytech RPC27-20nc in combination with a Cyclades terminal server. The Cyclades TS exports the RPC's serial port via a Telnet interface. Other interfaces, such as SSH, are possible. However, this script relies upon the assumption that Telnet is used. Future features to this agent would allow the agent to work with a multitude of different communication protocols such as Telnet, SSH or Kermit. The other assumption that is made is that Outlet names do not end in space. The name "Foo" and "Foo " are identical when the RPC prints them with the status command. fence_baytech accepts options on the command line as well as from stdin. fenced sends parameters through stdin when it execs the agent. fence_baytech can be run by itself with command line options which is useful for testing. Vendor URL: http://www.baytech.net OPTIONS
-a host IP address or hostname to connect to. -h Print out a help message describing available options, then exit. -l login Username name for the switch. -n port The name of the outlet to act upon. -o action The action required. This can be on, off, status or reboot (default) -p password Password for login. -S path Full path to an executable to generate the password for login. -q Quiet mode: print only error messages. -V Print out a version message, then exit. STDIN PARAMETERS
agent = < param > This option is used by fence_node(8) and is ignored by fence_baytech. host = < hostname | ip > IP address or hostname to connect to. login = < param > Login name. action = < param > The action required. This can be on, off, status or reboot (default) passwd = < param > Password for login. passwd_script = < param > Full path to an executable to generate the password for login. outlet = < param > The name of the outlet to act upon. SEE ALSO
fence(8), fence_node(8) fence_baytech(8)
All times are GMT -4. The time now is 08:38 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy