I'm using a hosts file, formatted like this:
xxx.xxx.xxx.xxx dnsname #comment
Current command is:
for host in 'awk '/^/ { print $1 }' etc/hosts'
do
ping $host 1 2>&1 | \
sed 's/.*no answer.*/[31;1m&[0m/;s/.*is alive.*/[32;2m[0m/'
done
(no... (5 Replies)
hello, I am looking to make a script that will ping a remote ip address. Upon completion of the ping I want the program to either ping again if the # of packets transmitted is equal to the number of packets received or exit if the two values are unequal and information was lost. I am not sure if I... (3 Replies)
I want find from a file , where list of hosts is given .
Whether SSH is running on that Hosts and
and create 2 files :
HOSt-SSH-Running
HOST-SSH-Not-running
In the list we have some Windows and Unix Servers, windows servers do not have sshd running. (2 Replies)
Hey Guys,
First time posting here. I keep getting back here on my google searches to help me in my scripting quest.
Can i ask for some guidance please?
I acquired a script, from these forums in fact that pings a list of IPs/Hostnames. Works a treat. Echos results to a file with the value... (3 Replies)
Hello all...I'm new to Unix and learning. What I'm trying to create is a script that will ping a known range of IP addresses, say 192.168.1.1 to 192.168.1.254. For each address that no reply is received, that address will be written to a log file that will be emailed to an administrator. My wife... (1 Reply)
Hi,
I am new to this world..
Using expect i loging to router and checking ping response to my links.
I need to genarate report using this output and that report contains only three file link name, packet loss, latency.
my output of script is like below:
-bash-3.00$ monmw/mwbkp... (2 Replies)
Hi,
I develop simple animation ping script on Solaris Platform. It is like Cisco ping.
Examples and source code are below.
bash-3.00$ gokcell 152.155.180.8 30
Sending 30 Ping Packets to 152.155.180.8
!!!!!!!!!!!!!.!!!!!!!!!!!!!!!.
% 93.33 success... % 6.66 packet loss...... (1 Reply)
HI,
I have a file serverlist in that all host names are placed.
i have written a small script
#./testping
#! /bin/bash
for i in `cat serverlist`
do
ping $i >> output.txt
done
so now it creates a file output.txt till here fine..
now each time i run this script the output file... (4 Replies)
help with bash script!
im am working on this script to make sure my server will stay online, so i made this script..
HOSTS="192.168.138.155"
COUNT=4
pingtest(){
for myhost in "$@"
do
ping -c "$COUNT" "$myhost" &&return 1
done
return 0
}
if pingtest $HOSTS
#100% failed... (4 Replies)
I have a script that logs into a server and pings several other servers in order to verify IP path between servers.
The output can look like this, if good pings:
Response from 1.1.1.4;_id=0, vlan_prio=0): seq=0 time=91.547 ms.
Response from 1.1.1.4;_id=0, vlan_prio=0): seq=1 time=61.176 ms.... (7 Replies)
Discussion started by: he204035
7 Replies
LEARN ABOUT ULTRIX
ping
ping(8) System Manager's Manual ping(8)Name
ping - send ICMP ECHO_REQUEST packets to network hosts
Syntax
/etc/ping [ options ] host [ datasize [ npackets ]]
Description
The DARPA Internet is a large and complex network of hardware connected together by gateways. The command utilizes the ICMP protocol's
mandatory ECHO_REQUEST datagram to elicit an ICMP ECHO_RESPONSE from a host or gateway. ECHO_REQUEST datagrams (pings) have an IP and ICMP
header, followed by a struct timeval, and then an arbitrary number of pad bytes used to fill out the packet. The length of the default
datagram 64 bytes, but this may be changed using the command-line option.
Typing ``ping host'' without any options will either report ``host is alive'' or ``no answer from host''. To get more statistics use the
-l option or one of the other options.
When using for fault isolation, it should first be run on the local host to verify that the local network interface is up and running.
Then, hosts and gateways further and further away should be pinged. The command with options sends one datagram per second and prints one
line of output for every ECHO_RESPONSE returned. No output is produced if there is no response. If an optional npackets is given, only
that number of requests is sent. Round-trip times and packet loss statistics are computed. When all responses have been received or the
program times out with npackets specified, or if the program is terminated with a SIGINT, a brief summary is displayed.
Options-d Turns on SO_DEBUG flag on the socket.
-l Gives more statistics than if is used without options. Long output.
-r Bypasses the normal routing tables and sends directly to a host on an attached network. If the host is not on a directly-attached
network, an error is returned. This option can be used to ping a local host through an interface that has no route through it. For
example, after the interface was dropped by
-v Lists ICMP packets other than ECHO RESPONSE that are received. Verbose output.
Restrictions
This program is intended for use in network testing, measurement, and management. It should be used primarily for manual fault isolation.
Because of the load it could impose on the network, it is unwise to use during normal operations or from automated scripts.
See Alsonetstat(1), ifconfig(8c)ping(8)