Hi,
Hope all your are doing well. Need a suggestion from you.
I am writing an automated shell script that will effectively check the telnet connectivity with different backends from present deployment server.
Ideally, this script reads each backend hostname from a configuration file and fires telnet command on that. like
but the catch here is, if the connection is established shell holds the prompts there, it does not automatically exits. I get something like
Sometime if the remote host does not respond then it holds for long time,
This symbolises we need manual intervention clearly to come out. I want script should wait for certain interval if it does not get response come out and try next host.
Any ideas how to implement?
I can not use expect technogloy as it is not permitted in our environment.
I tried google and search in this forum as well, but did find a suitable approach.
Please let me know your ideas, any help would be very much appreciated.
Making it quit once it connects at least might be more doable. Redirect standard input from /dev/null. It will try to read from stdin once it connects, get EOF, and quit normally.
telnet doesn't seem to have any timeout options. It's a pain in general to automate. You'll have to kill it externally.
Is netcat (nc) available? It has timeouts and such, and doesn't depend on terminals, so is much less torturous to automate.
It was indeed a great experience to run your snippet.
I varied the waiting time and launched the process in background was indeed a good idea. May be I tried reading from config file rather than /dev/null it also worked.
Thanks a lot for this idea!!
I think nc is available in our env and it can be used as a substitute of telnet command. I will suggest these to team members.
Slightly off topic. Port 443 is not normally used for telnet.
If you are trying to write some sort of port scanner be very careful. It is possible to crash a system by firing whatever ports are live in "inetd". I have also seen systems block all incoming TCP/IP connections when under attack thus causing a "denial of service" situation.
Hello everybody,
I am coding a script, that allow the user to enter some information using prompt messages, i.e:
sEpisode=1
read -e -i "$sEpisode" -p "Start download from episode: " downloadFrom
sEpisode="${downloadFrom:-$sEpisode}"
This code allows the user to set the download from... (4 Replies)
Hi ,
I am not able to exit fom zone console login prompt.
I have tried options like
~. ~~. and @. but it is not working fo me.
Could someone Please help me on this.
Thanks in Advance!!
Regards,
Laxxi (7 Replies)
Hi,
I am trying to start Weblogic Admin server using start-up script (./startWeblogic.sh) from a remote host using a different user. The server starts fine but prompt is stuck, it does not return
Background: We have multiple admin servers in different environment and the requirement is all... (4 Replies)
I want the text based Star Wars movie at towel.blinkenlights.nl to loop infinitely.
It plays the movie and then disconnects my session? Can anyone think of a way to make my unix machine automatically reconnect over and over?
EDIT
no commands are required are the connection its just in and... (3 Replies)
I have a ksh script, which pbruns into another account.
I want to pbrun run into that account, and continue running all the engine commands(i.e setroot, setsite xxx, etc) in my script.
But instead, it pbruns into the account, and just gives me a shell prompt.. and stops there.
Only once i... (2 Replies)
Hi,
The code below is used to telnet to list of devices and configure them. The program executes in this manner:
1. telnet to the first device in file.txt
2. one the telnet command is executed a "press any key to continue" prompts.
3. once a return key is executed it ask for username,... (1 Reply)
Hi,
i have typed telnet yahoo.com 80 in command prompt
it displays as a blank command prompt page titling as Telnet Yahoo.com
Other than that i am not able to get anything. can anyone sort me out the reason for this (12 Replies)
Hi,
I need to do a test Telnet in KSH and if the connection is good then disconnect the telnet session with out logging in and without exiting the shell script.
Example output of a good connection:
$telnet xxx.xx.xx.xxx xxxx
Trying xxx.xx.xx.xxx...
Connected to xxx.xx.xx.xxx.
Escape... (1 Reply)
Hi All,
I need the exit status of a command which is executed through sftp connection.
Example:
sftp user@host <<EOF
mkdir /home/karteek/testing
put /home/xyz.txt /home/karteek/testing
EOF
------
In the above example, I need the exit status of the put command.
Please help me.
... (2 Replies)
ssh user@host -q -n 'grep `hostname` /etc/hosts; telnet 10.100.23.45 1234;'
When i run this command remotely it is hanging and not giving me the prompt, Can anyone tell me how can I exit a telnet command remotely please.
Thanks. (10 Replies)