Sponsored Content
Full Discussion: Telnet non interactive
Operating Systems AIX Telnet non interactive Post 302363392 by shahnazurs on Tuesday 20th of October 2009 07:54:19 AM
Old 10-20-2009
Thanks indeed for that link.

but it has the following line

Code:
# Assume $remote_server, $my_user_id, $my_password, and $my_command were read in earlier 
  # in the script.  # Open a telnet session to a remote server, and wait for a username prompt.
  spawn telnet $remote_server
  expect "username:"  # Send the username, and then wait for a password prompt.
  send "$my_user_id\r"
  expect "password:"  # Send the password, and then wait for a shell prompt.
  send "$my_password\r"
  expect "%"  # Send the prebuilt command, and then wait for another shell prompt.
  send "$my_command\r"
  expect "%"  # Capture the results of the command into a variable. This can be displayed, or written to disk.
  set results $expect_out(buffer)  # Exit the telnet session, and wait for a special end-of-file character.
  send "exit\r"
  expect eof

I didn't see this script working, Can you please say what needs to be done to make telnet interactive.
I search lot of sites through search engine but none gave exact information.

Thanks,
Shahnaz
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Interactive String

I intend to write a script, where the user will supply the name of the specific string that script should work on. The first question is how do I accept the string, i.e interactively? and the second question how would the string be refrenced ? Thanks in advance, Odogbolu98 :( (3 Replies)
Discussion started by: odogbolu98
3 Replies

2. UNIX for Dummies Questions & Answers

Interactive Mode?

:confused: Can anyone please tell me how to get into Interactive Mode? (2 Replies)
Discussion started by: Nomad
2 Replies

3. Shell Programming and Scripting

Interactive menu

Hi ,some time ago i did an interactive menu based on eval function for navigation , one of the post remind me it. I think it could be handy for others. #!/usr/bin/ksh keyRead () { tput smso echo "Enter option." tput rmso oldstty=$(stty -g) stty -icanon -echo min 1 time 1 Answer=$(dd... (0 Replies)
Discussion started by: Klashxx
0 Replies

4. Shell Programming and Scripting

Webpage to Telnet via Perl and Expect: Telnet problem?

Somewhat long story: I have a simple Perl CGI script that uses Expect to Telnet to a device and grab some data, and then spits it back to Perl for display on the Webpage. This works for many devices I've tried, but one device just fails, it keeps rejecting the password on this device, only... (1 Reply)
Discussion started by: jondo
1 Replies

5. Homework & Coursework Questions

Help with Interactive / Non Interactive Shell script

Q. Write a script that behaves both in interactive and non interactive mode. When no arguments are supplied it picks up each C program from the directory and prints first 10 lines. It then prompts for deletion of the file. If user supplies arguments with the script , then it works on those files... (1 Reply)
Discussion started by: rits
1 Replies

6. Homework & Coursework Questions

How to write script that behaves both in interactive and non interactive mode

Q. Write a script that behaves both in interactive and non interactive mode. When no arguments are supplied it picks up each C program from the directory and prints first 10 lines. It then prompts for deletion of the file. If user supplies arguments with the script , then it works on those files... (8 Replies)
Discussion started by: rits
8 Replies

7. Shell Programming and Scripting

non interactive vim

I wanna edit a file non-interactively using vim editor The file contains a line: ACTIVATIONCODE= I have a variable called ACT. I want to edit the file non-interactively using vim such that the concerned line is converted to: ACTIVATIONCODE=contents of the variable ACT ---------- Post... (1 Reply)
Discussion started by: proactiveaditya
1 Replies

8. Shell Programming and Scripting

Interactive script

Greetings gurus I have this simple scripts #!/bin/bash find /kl1/CTT/TQI_001/330_spike/sz00/latcon1/ -type d -name "*.dig" > data_schema find /kl1/CTT/TQI_001/330_spike/sz00/latcon1/ -type d -name "*.dig" >> data_schema <data.schema awk '{print NR, "inVol=" $0, "setDt=4000",... (1 Reply)
Discussion started by: Marjan
1 Replies

9. UNIX for Dummies Questions & Answers

Automatically login in the telnet from present telnet

Hi, I was writing one script which includes to switch to the another telnet automatically from the present telnet server. I was using rlogin but firstly it takes the same user name of the present telnet and secondly it is prompting for the password. But i want to switch to the another telnet... (2 Replies)
Discussion started by: Prateek
2 Replies

10. UNIX for Dummies Questions & Answers

Difference Between Krb5-telnet And Ekrb5-telnet

Hi, I want to know the difference between these two services. Both are under xinetd. Both are used for enabling and disabling Telnet service. So, can somebody please explain me the difference between the two ? Thanks in advance :) (0 Replies)
Discussion started by: kashifsd17
0 Replies
FENCE_AGENT(8)						      System Manager's Manual						    FENCE_AGENT(8)

NAME
fence_rsa - Fence agent for IBM RSA DESCRIPTION
fence_rsa is an I/O Fencing agent which can be used with the IBM RSA II management interface. It logs into an RSA II device via telnet and reboots the associated machine. Lengthy telnet connections to the RSA II device should be avoided while a GFS cluster is running because the connection will block any necessary fencing actions. fence_rsa accepts options on the command line as well as from stdin. Fenced sends parameters through stdin when it execs the agent. fence_rsa can be run by itself with command line options. This is useful for testing and for turning outlets on or off from scripts. Vendor URL: http://www.ibm.com PARAMETERS
-o, --action=<action> Fencing Action (Default Value: reboot) -a, --ip=<ip> IP Address or Hostname This parameter is always required. -l, --username=<name> Login Name This parameter is always required. -p, --password=<password> Login password or passphrase -S, --password-script=<script> Script to retrieve password -c, --command-prompt=<prompt> Force command prompt (Default Value: >) -x, --ssh SSH connection -k, --identity-file=<filename> Identity file for ssh -u, --ipport=<port> TCP port to use for connection with device -v, --verbose Verbose mode -D, --debug-file=<debugfile> Write debug information to given file -V, --version Display version information and exit -h, --help Display help and exit --power-timeout Test X seconds for status change after ON/OFF (Default Value: 20) --shell-timeout Wait X seconds for cmd prompt after issuing command (Default Value: 3) --login-timeout Wait X seconds for cmd prompt after login (Default Value: 10) --power-wait Wait X seconds after issuing ON/OFF (Default Value: 0) --delay Wait X seconds before fencing is started (Default Value: 0) --retry-on Count of attempts to retry power on (Default Value: 1) ACTIONS
on Power on machine. off Power off machine. reboot Reboot machine. status This returns the status of the plug/virtual machine. list List available plugs with aliases/virtual machines if there is support for more then one device. Returns N/A otherwise. monitor Check if fencing device is running. List available plugs/virtual machines or get status of machine (if it does not support more). metadata The operational behavior of this is not known. STDIN PARAMETERS
action Fencing Action (Default Value: reboot) ipaddr IP Address or Hostname This parameter is always required. login Login Name This parameter is always required. passwd Login password or passphrase passwd_script Script to retrieve password cmd_prompt Force command prompt (Default Value: >) secure SSH connection identity_file Identity file for ssh ipport TCP port to use for connection with device verbose Verbose mode debug Write debug information to given file version Display version information and exit help Display help and exit power_timeout Test X seconds for status change after ON/OFF (Default Value: 20) shell_timeout Wait X seconds for cmd prompt after issuing command (Default Value: 3) login_timeout Wait X seconds for cmd prompt after login (Default Value: 10) power_wait Wait X seconds after issuing ON/OFF (Default Value: 0) delay Wait X seconds before fencing is started (Default Value: 0) retry_on Count of attempts to retry power on (Default Value: 1) fence_rsa (Fence Agent) 2009-10-20 FENCE_AGENT(8)
All times are GMT -4. The time now is 07:11 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy