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
IBV_UC_PINGPONG(1)						   USER COMMANDS						IBV_UC_PINGPONG(1)

NAME
ibv_uc_pingpong - simple InfiniBand UC transport test SYNOPSIS
ibv_uc_pingpong [-p port] [-d device] [-i ib port] [-s size] [-r rx depth] [-n iters] [-l sl] [-e] HOSTNAME ibv_uc_pingpong [-p port] [-d device] [-i ib port] [-s size] [-r rx depth] [-n iters] [-l sl] [-e] DESCRIPTION
Run a simple ping-pong test over InfiniBand via the reliable connected (RC) transport. OPTIONS
-p, --port=PORT use TCP port PORT for initial synchronization (default 18515) -d, --ib-dev=DEVICE use IB device DEVICE (default first device found) -i, --ib-port=PORT use IB port PORT (default port 1) -s, --size=SIZE ping-pong messages of size SIZE (default 4096) -r, --rx-depth=DEPTH post DEPTH receives at a time (default 1000) -n, --iters=ITERS perform ITERS message exchanges (default 1000) -l, --sl=SL use SL as the service level value of the QP (default 0) -e, --events sleep while waiting for work completion events (default is to poll for completions) SEE ALSO
ibv_rc_pingpong(1), ibv_ud_pingpong(1), ibv_srq_pingpong(1) AUTHORS
Roland Dreier <rolandd@cisco.com> BUGS
The network synchronization between client and server instances is weak, and does not prevent incompatible options from being used on the two instances. The method used for retrieving work completions is not strictly correct, and race conditions may cause failures on some systems. libibverbs August 30, 2005 IBV_UC_PINGPONG(1)
All times are GMT -4. The time now is 09:56 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy