Sponsored Content
Full Discussion: telnet to another server
Top Forums Shell Programming and Scripting telnet to another server Post 302331347 by kshji on Monday 6th of July 2009 01:26:14 AM
Old 07-06-2009
Ex. ping is not service test. If you like to test some tcp/ip service, use that service = only correct method to check service.
And use ip and port/service number - test only service, not own dns, ...
Create socket ex. socket.sh 111.111.111.111 23
Code:
#!/usr/bin/ksh
host=$1
port=$2
exec 4<>/dev/tcp/$host/$port
exit $?

Using that nice ksh93 script, you can do something like (check.sh):
Code:
#!/usr/bin/ksh
ip=$1
port=$2
waittime=$3
while true 
do
        ./socket.sh  "$ip" "$port"  ||  ./not_ok.sh "$ip" "$port"
        sleep $waittime
done

Code:
chmod a+rx *.sh
# ex. port 23 = usually telnet, wait 300 s
./check.sh  xx.xxx.xxx.xx  23 300 >> telnet.log 2>&1     &

Now you can write your not_ok.sh script as you like.

Last edited by kshji; 07-06-2009 at 02:32 AM..
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Telnet Server

Good day, We have recently purchased an HP Compaq t5000 thin client and installed this as a management console. It runs Windows CE 5.0 as we required Internet Explorer for the managemenet of the one server (Web based management only working in Internet Explorer). We have now also installed... (4 Replies)
Discussion started by: avd
4 Replies

2. UNIX for Advanced & Expert Users

I access to my server via Telnet

I use server Unix with AIX 5.2. I can't telnet to server about 5 mn, then i can access to server via telnet. This problem have again and again. Sometime can, sometime can't. I dont know why? Do you have any idea? (4 Replies)
Discussion started by: SENG
4 Replies

3. UNIX for Dummies Questions & Answers

telnet to remote server

Hi every1 well i am new to unix scripting but i have been seeking help from this forum the question i want to write a script to telnet to a remote server and put the username and pwd in the script the problem is that i want to run some commands on the remote server and get the results in a... (2 Replies)
Discussion started by: hassanabbas
2 Replies

4. Solaris

cannot telnet after restarting server

Dear guys, Pls help me this case. I telnet normally to Solaris. After restarting it manually, I can only console, cannot telnet from my latop although I can ping it. I checked /etc/default/login /usr/sbin/in.telnetd /etc/inet/inetd.conf All these files are the same. I don't see telnet... (2 Replies)
Discussion started by: wipi
2 Replies

5. AIX

Unable to telnet to server

Hi, I encountered error when I telnet to my server. Error is as follows: telnetd: /bin/login: The file access permissions do not allow the specified action I am able to ssh into my server and I have checked/verified /etc/security and /etc/inetd.conf. I restarted the inetd subsystem via... (1 Reply)
Discussion started by: chongkls77
1 Replies

6. Shell Programming and Scripting

How to auto telnet the server from another server using script

Hi All, I have a problem with auto telnet script, but I want to tell u something a) I am only a member access on the server, so not able to access 'root' account b) not able to install any software on server 3) On server, there is not install 'except' I have to write a script, which is ran... (0 Replies)
Discussion started by: atul9806
0 Replies

7. Homework & Coursework Questions

How to auto telnet the server from another server

Hi All, I have a problem with auto telnet script, but I want to tell u something a) I am only a member access on the server, so not able to access 'root' account b) not able to install any software on server 3) On server, there is not install 'except' 1. The problem statement, all variables... (0 Replies)
Discussion started by: atul9806
0 Replies

8. Homework & Coursework Questions

How to auto telnet the server from another server?

Hi All, I have a problem with auto telnet script, but I want to tell u something a) I am only a member access on the server, so not able to access 'root' account b) not able to install any software on server 3) On server, there is not install 'except' 1. The problem statement, all variables... (8 Replies)
Discussion started by: atul9806
8 Replies

9. UNIX for Dummies Questions & Answers

Telnet server

I need a list of servers, that, I can try out my test program with, such as a timeserver. For example, I would need to connect to telnet server|port. (1 Reply)
Discussion started by: jon80
1 Replies

10. SCO

Not able to telnet to server

Out of the blue for some odd reason I am no longer able to telnet to one of my SCO Unix servers. I can ping, ftp and do a traceroute to it, just cant telnet. When I attempt to telnet to it, I just get this Trying ##.##.##.##.... telnet: Unable to connect to remote host: Connection timed out ... (0 Replies)
Discussion started by: macastor
0 Replies
wnn_serverdefs(4)						   File Formats 						 wnn_serverdefs(4)

NAME
wnn_serverdefs - Wnn6 Kana-Kanji conversion server connection parameter configuration file SYNOPSIS
/etc/lib/locale/ja/wnn/serverdefs DESCRIPTION
serverdefs configures the connection between clients and the Wnn6 Kana-Kanji conversion server. The Wnn6 library refers to this file to connect the conversion server. Lines beginning with semicolons (;) are comments. SYNTAX <LANG_name> <server_host_name> <UNIX_DOMAIN_socket_name> <service_name> <port_number> <environment_variable_name> <LANG_name> Specifies the language. xjsi and uum refers the line containing "ja". <server_host_name> Specifies the host name of the conversion server. <UNIX_DOMAIN_socket_nameSpecifies the socket's terminal to use if connection is made to a unix domain socket. <service_name> Specifies the name of the tcp service to use if connection is made to an inet domain socket. <port_number> Specifies the tcp port number to use if connection is made to an inet domain socket. If the service name is not found, this port number will be used. This port number may be omitted. <environmental_variable_Specifies the environment variable name set to the host name of the conversion server. EXAMPLES
Example 1: ja jserver /tmp/jd_sockV6 wnn6 22273 JSERVER SEE ALSO
uum(1), xjsi(1), jserver(1M) SunOS 5.10 10 Jan 2003 wnn_serverdefs(4)
All times are GMT -4. The time now is 06:44 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy