Sponsored Content
Top Forums Shell Programming and Scripting Testing connection with a script Post 302351260 by matrixmadhan on Tuesday 8th of September 2009 12:24:14 AM
Old 09-08-2009
Welcome to the forum !

This is just a hint and am not very thorough with this.

Ping works using ICMP and a host might be still up and not accepting/responding to ICMP packets, in such cases ping might not help with. Instead, check if the destination ip is reachable. If that is so, start the process from the local host where request is initiated.

Let us know, how it goes Smilie
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Testing ssh connection from KSH script

Hi. I have a kornshell script that runs on a daily basis as a cron job. Part of what the script does is copy the folder contents from another server to the current server (server where KSH script is running). I have a scp command, as follows: scp $REMOTE_HOST:$REMOTE_FILE_DIR/* $TMP_DIR ... (8 Replies)
Discussion started by: dmilks
8 Replies

2. Shell Programming and Scripting

Testing VPN Connection

Hi All: I need a script that can be timed to run every half hour to an hour to run a traceroute through a VPN to test that a connection is still up from a Win XP system. Which would be the best, C++ or Perl and what are some good resources to look at. (If anyone has a script to do this... (1 Reply)
Discussion started by: maxhewitt
1 Replies

3. Solaris

Testing physical network connection

How do you test the physical network connection of an interface in solaris. I know that if you have an active connection and the cable gets yanked, you can look in the messages file to check for link failure messages. But is there any better way to see if you have good layer 2 connectivity? (1 Reply)
Discussion started by: tjlst15
1 Replies

4. Shell Programming and Scripting

Testing telnet connections in a script

Hi, I am trying to figure out how to test to see if a server is accepting telnet connections via a script. I have several remote MPE servers that are set in single user mode (and hence not accepting telnet connections), for their backups, I want to try and automate a test (from a unix... (0 Replies)
Discussion started by: dikiee
0 Replies

5. Shell Programming and Scripting

Testing a comand in the script

Hi everyone , i am new to shell scripting and am having some problem to test if this line has been executed well and display a pass message on the screen or fail if not sqlplus XXTEST/$2 <<END > $XXTEST_TOP/log/$0.log @$XXTEST_TOP/admin/sql/XXTEST_SPE1_XX_QUOTE_DETAILS_TBL.sql XXTEST$2... (2 Replies)
Discussion started by: Lutchumaya
2 Replies

6. Shell Programming and Scripting

testing a dhcp connection

Hi there, I have a computers that has a fixed address : terminal48:~# cat /etc/network/interfaces # This file describes the network interfaces available on your system # and how to activate them. For more information, see interfaces(5). # The loopback network interface auto lo iface lo... (1 Reply)
Discussion started by: chebarbudo
1 Replies

7. Solaris

Solaris 10 ftp connection problem (connection refused, connection timed out)

Hi everyone, I am hoping anyone of you could help me in this weird problem we have in 1 of our Solaris 10 servers. Lately, we have been having some ftp problems in this server. Though it can ping any server within the network, it seems that it can only ftp to a select few. For most servers, the... (4 Replies)
Discussion started by: labdakos
4 Replies

8. Shell Programming and Scripting

Package version testing script

I was wondering if anyone already had a script to check rpm packages versions x.x.x or greater. so I could do a: # CheckRpmVersion Somepackage-1.2.3 And would output: whether the package is installed or not and if it was equal to or greater than the version 1.2.3. I know I can pull out... (0 Replies)
Discussion started by: Ikon
0 Replies

9. Shell Programming and Scripting

testing postgres connection in shell script

I have a script that does db query in postgres. I'm trying to put in some error checking in the script. I keep running into the password prompt problem where when invalid credentials/or database is put it, it would prompt me for a password which hangs the script. Is there a way that I can check for... (0 Replies)
Discussion started by: zerofire123
0 Replies

10. Shell Programming and Scripting

Script Testing

Hello Scripting Czars I have written one script, which does the Openssl Connection test to 1000's of server's , but before it finally takes off , its error-ring out, kindly take a look into this. #!/bin/bash #Script to Test Connectivity withListen Address & Port Address #Script... (10 Replies)
Discussion started by: raghunsi
10 Replies
ICMP(4) 						   BSD Kernel Interfaces Manual 						   ICMP(4)

NAME
icmp -- Internet Control Message Protocol SYNOPSIS
#include <sys/socket.h> #include <netinet/in.h> int socket(AF_INET, SOCK_RAW, proto); DESCRIPTION
ICMP is the error and control message protocol used by IP and the Internet protocol family. It may be accessed through a ``raw socket'' for network monitoring and diagnostic functions. The proto parameter to the socket call to create an ICMP socket is obtained from getprotobyname(3). ICMP sockets are connectionless, and are normally used with the sendto and recvfrom calls, though the connect(2) call may also be used to fix the destination for future packets (in which case the read(2) or recv(2) and write(2) or send(2) system calls may be used). Outgoing packets automatically have an IP header prepended to them (based on the destination address). Incoming packets are received with the IP header and options intact. Note that the ip_off and ip_len fields are in host byte order. For more information about the IP header structure, see ip(4). Non-privileged ICMP ICMP sockets can be opened with the SOCK_DGRAM socket type without requiring root privileges. The synopsis is the following: socket(AF_INET, SOCK_DGRAM, IPPROTO_ICMP) Datagram oriented ICMP sockets offer a subset of the functionality available to raw ICMP sockets. Only IMCP request messages of the following types can be sent: ICMP_ECHO, ICMP_TSTAMP or ICMP_MASKREQ. The code field must be the value zero (0). The minimal length of an ICMP message request is eight (8) octets. The advantage of using datagram oriented ICMP sockets is that even a non-privileged process can use ICMP echo requests to gauge the quality of the connectivity to a host, or to receive ICMP destination unreachable message for path MTU discovery, or to receive time exceeded mes- sages for traceroute. The following IP level option can be used with datagram oriented ICMP sockets: IP_OPTIONS IP_HDRINCL IP_TOS IP_TTL IP_RECVOPTS IP_RECVRETOPTS IP_RECVDSTADDR IP_RETOPTS IP_MULTICAST_IF IP_MULTICAST_TTL IP_MULTICAST_LOOP IP_ADD_MEMBERSHIP IP_DROP_MEMBERSHIP IP_MULTICAST_VIF IP_PORTRANGE IP_RECVIF IP_IPSEC_POLICY IP_STRIPHDR When the IP option IP_HDRINCL is used, the provided IP header must obey the following rules: ip_v Must be IPVERSION (4); ip_hl Between 5 and 10 (inclusive); ip_tos Any value; ip_len Must be the total length of IP datagram (IP header + ICMP message); ip_id Must be zero, will be automatically set; ip_off Must be zero, will be automatically set; ip_ttl Any value; ip_p Must be IPPROTO_IP; ip_sum Value ignored, will be automatically set; ip_src Must be an IP address currently assigned to one of the local interface or INADDR_ANY; ip_dst Any address; ip_opts Any option. The maximum length of a IMCP message that can be sent is controlled by the sysctl variable net.inet.raw.maxdgram. DIAGNOSTICS
A socket operation may fail with one of the following errors returned: [EISCONN] when trying to establish a connection on a socket which already has one, or when trying to send a datagram with the destina- tion address specified and the socket is already connected; [ENOTCONN] when trying to send a datagram, but no destination address is specified, and the socket hasn't been connected; [ENOBUFS] when the system runs out of memory for an internal data structure; [EADDRNOTAVAIL] when an attempt is made to create a socket with a network address for which no network interface exists; [EINVAL] when an invalid value is used with IMCP datagram socket for a field of the IP or ICMP header. SEE ALSO
recv(2), send(2), inet(4), intro(4), ip(4) HISTORY
The icmp protocol appeared in 4.3BSD. 4.3 Berkeley Distribution June 19, 2002 4.3 Berkeley Distribution
All times are GMT -4. The time now is 10:49 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy