Sponsored Content
Full Discussion: Pinging Host
Special Forums UNIX Desktop Questions & Answers Pinging Host Post 302961944 by Don Cragun on Monday 7th of December 2015 12:03:12 AM
Old 12-07-2015
Quote:
Originally Posted by 5sku5
I need to ping websites and I need to see which one has the highest delay.

My problem is I need to extract the name Facebook and the time=74.0 ms using awk. I need help doing this please...



Code:
PING facebook.com (173.252.90.36) 56(84) bytes of data.
64 bytes from edge-star-mini-shv-13-atn1.facebook.com (173.252.90.36): icmp_req=1 ttl=76 time=74.0 ms

--- facebook.com ping statistics ---
1 packets transmitted, 1 received, 0% packet loss, time 0ms
rtt min/avg/max/mdev = 74.087/74.087/74.087/0.000 ms
PING pbs.org (23.21.237.247) 56(84) bytes of data.

You say you want to extract Facebook from the data you showed us, but that string does not appear anywhere in the data you showed us.

Are all of the time values in milliseconds? I.e., do you need to extract the string ms, or do you just need the number following time=? (If you're trying to find a maximum time, it is much easier to get what you want if you are comparing numeric values instead of comparing alphanumeric strings. For example, as a number 11 is greater than 9, but the string "9 ms" is lexically greater than "11 ms".)

Why do you want "74 ms" instead of the "max" entry out of:
Code:
rtt min/avg/max/mdev = 74.087/74.087/74.087/0.000 ms

i.e., 74.087?

Do all of the ping entries you're processing just have one packet transmitted? (I.e., is what you showed us representative data of the input you're trying to process?)

What have you tried to solve this problem on your own?
 

10 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Server stopped pinging (in and out)

hi All my Redhat Linux server stopped responding to pings all together. and am also not able to ping out of the box. There are however no issues with internet connectivity and my application is working fine. When I tried to ping another machine (Win98) i could see the pings coming from my... (2 Replies)
Discussion started by: skotapal
2 Replies

2. AIX

pinging IP's in a file

Hey all. I have a long list of IP addresses I want to ping. The IP's are located in a flat file "ping_info.dat". I was wondering what the best way to go about this would be. Can someone help me out? (2 Replies)
Discussion started by: jalge2
2 Replies

3. Shell Programming and Scripting

pinging an ip

Hi, How to ping an ip from an unix machine. Can you please let me know the exact command. I used and i got the below error ping 171.18.17.2 bash: ping: command not found Thanks n regards Ammu (1 Reply)
Discussion started by: ammu
1 Replies

4. UNIX for Advanced & Expert Users

Alternate to pinging boxes

Hello, We have boxes on a WAN network I guess you would call it, pretty much they are hooked up via DSL in different locations in the US and we connect to them via SSH for a secure connection. Some of the boxes won't return a ping request like they are down, I am guessing is because the router... (5 Replies)
Discussion started by: benefactr
5 Replies

5. Shell Programming and Scripting

Forking and Pinging

Keep in mind that I haven't done Perl scripting for a LONG time, so I'm quite rusty. This is what I would like to do: - using fork, create 3 or 4 processes to read 3 or 4 different text documents containing server names or IP addresses - in each of those processes, Perl will ping each of those... (7 Replies)
Discussion started by: kooshi
7 Replies

6. Solaris

Server Pinging Problem

Dear all, I face some problem as below. I have a sun fire 280r server in a network. From that server i am able to ping any system in any network. But i am facing the problem when i try to ping the server from outside netwok. Once i give ping command in the server then only i try to... (1 Reply)
Discussion started by: sudhansu
1 Replies

7. Shell Programming and Scripting

Pinging a domain

how can you ping a domain and store the ip? like given a url in a variable $url how can i ping it? also how can i find the local server's ip address on a cpanel server? (i have multiple servers and didnt want to hard code it in) (basically i want to check the domain accounts on the server,... (11 Replies)
Discussion started by: vanessafan99
11 Replies

8. IP Networking

Pinging IP located on another interface

Hi, I have a rather strange IP question... Here's my problem: I have a Linux box (call it "turing") with 2 NICs. One network interface (eth0) has an IP assigned, say 192.168.42.50. The other interface (eth1) is up, but has no IP yet. My question: is it possible to determine from... (3 Replies)
Discussion started by: NH2
3 Replies

9. Emergency UNIX and Linux Support

Script for pinging continuously

Hi, I need to set up a script that would write the results of the ping command from one AIX server to another file may be every minute. Like this I need to gather the data for a period of 24 hours. Can someone please help me with this? G (5 Replies)
Discussion started by: ggayathri
5 Replies

10. Shell Programming and Scripting

Pinging 5 hosts once every hour

Hello folks; I'm trying to write a shell script to ping 5 hosts i have once every 1 hour and if it receives any failure from any of those hosts, it sends an email alert with the results from this failing ping. Any help would be greatly appreciated (1 Reply)
Discussion started by: Katkota
1 Replies
2PING(8)																  2PING(8)

NAME
2ping - A bi-directional ping client/listener SYNOPSIS
2ping [ options ] --listen | host/IP DESCRIPTION
2ping is a bi-directional ping utility. It uses 3-way pings (akin to TCP SYN, SYN/ACK, ACK) and after-the-fact state comparison between a 2ping listener and a 2ping client to determine which direction packet loss occurs. To use 2ping, start a listener on a known stable network host. The relative network stability of the 2ping listener host should not be in question, because while 2ping can determine whether packet loss is occurring inbound or outbound relative to an endpoint, that will not help you determine the cause if both of the endpoints are in question. Once the listener is started, start 2ping in client mode and tell it to connect to the listener. The ends will begin pinging each other and displaying network statistics. If packet loss occurs, 2ping will wait a few seconds (default 10, configurable with -w) before comparing notes between the two endpoints to determine which direction the packet loss is occurring. To quit 2ping on the client or listener ends, enter ^C, and a list of statistics will be displayed. To get a short inline display of statistics without quitting, send the process a QUIT signal (yes, that's the opposite of what you would think, but it's in line with the normal ping utility). OPTIONS
ping-compatible options: -a Audible ping. -A Adaptive ping. A new client ping request is sent as soon as a client ping response is received. If a ping response is not received within the interval period, a new ping request is sent. Minimal interval is 200msec for not super-user. On networks with low rtt this mode is essentially equivalent to flood mode. 2ping-specific notes: This behavior is somewhat different to the nature of ping's adaptive ping, but the result is roughly the same. -c count Stop after sending count ping requests. 2ping-specific notes: This option behaves slightly differently from ping. If both -c and -w are specified, satisfaction of -c will cause an exit first. Also, internally, 2ping exits just before sending count+1 pings, to give time for the ping to complete. -f Flood ping. For every ping sent a period "." is printed, while for ever ping received a backspace is printed. This provides a rapid display of how many pings are being dropped. If interval is not given, it sets interval to zero and outputs pings as fast as they come back or one hundred times per second, whichever is more. Only the super-user may use this option with zero interval. 2ping-specific notes: Detected outbound/inbound loss responses are printed as ">" and "<", respectively. Receive errors are printed as "E". Due to the asynchronous nature of 2ping, successful responses (backspaces) may overwrite these loss and error characters. -i interval Wait interval seconds between sending each ping. The default is to wait for one second between each ping normally, or not to wait in flood mode. Only super-user may set interval to values less 0.2 seconds. -I interface IP Set source IP address. When pinging IPv6 link-local address this option is required. When in listener mode, this option may be specified multiple to bind to multiple IP addresses. When in client mode, this option may only be specified once, and all outbound pings will be bound to this source IP. 2ping-specific notes: This option only takes an IP address, not a device name. Note that in listener mode, if the machine has an interface with multiple IP addresses and an request comes in via a sub IP, the reply still leaves via the interface's main IP. So this option must be used if you would like to respond via an interface's sub-IP. -l preload If preload is specified, 2ping sends that many packets not waiting for reply. Only the super-user may select preload more than 3. -p pattern You may specify up to 16 "pad" bytes to fill out the packets you send. This is useful for diagnosing data-dependent problems in a network. For example, -p ff will cause the sent packet pad area to be filled with all ones. 2ping-specific notes: This pads the portion of the packet that does not contain the active payload data. If the active payload data is larger than the minimum packet size (--min-packet-size=min), no padding will be sent. -q Quiet output. Nothing is displayed except the summary lines at startup time and when finished. -s packetsize ping compatibility, this will set --min-packet-size to this plus 8 bytes. -v Verbose output. In 2ping, this prints decodes of packets that are sent and received. -V Show version and exit. -w deadline Specify a timeout, in seconds, before 2ping exits regardless of how many pings have been sent or received. Due to blocking, this may occur up to one second after the deadline specified. 2ping-specific notes: This option behaves slightly differently from ping. If both -c and -w are specified, satisfaction of -c will cause an exit first. 2ping-specific options: -?, --help Print a synposis and exit. -6, --ipv6 Bind/connect as IPv6. --auth=key Set a shared key, send cryptographic hashes with each packet, and require cryptographic hashes from peer packets signed with the same shared key. --auth-digest=digest When --auth is used, specify the digest type to compute the cryptographic hash. Valid options are hmac-md5 (default), hmac-sha1 and hmac-sha256. hmac-md5 requires Digest::MD5, and the SHA digests require Digest::SHA. --debug Print (lots of) debugging information. --inquire-wait=secs Wait at least secs seconds before inquiring about a lost packet. Default is 10 seconds. UDP packets can arrive delayed or out of order, so it is best to give it some time before inquiring about a lost packet. --listen Start as a listener. The listener will not send out ping requests at regular intervals, and will instead wait for the far end to initiate ping requests. A listener is required as the remote end for a client. --min-packet-size=min Set the minimum total payload size to min bytes, default 128. If the payload is smaller than min bytes, padding will be added to the end of the packet. --max-packet-size=max Set the maximum total payload size to max bytes, default 512, absolute minimum 64. If the payload is larger than max bytes, information will be rearranged and sent in future packets when possible. --no-3way Do not perform 3-way pings. Used most often when combined with --listen, as the listener is usually the one to determine whether a ping reply should become a 3-way ping. Strictly speaking, a 3-way ping is not necessary for determining directional packet loss between the client and the listener. However, the extra leg of the 3-way ping allows for extra chances to determine packet loss more efficiently. Also, with 3-way ping disabled, the listener will receive no client performance indicators, nor will the listener be able to determine directional packet loss that it detects. --no-match-packet-size When sending replies, 2ping will try to match the packet size of the received packet by adding padding if necessary, but will not exceed --max-packet-size. --no-match-packet-size disabled this behavior, always setting the minimum to --min-packet-size. --no-send-version Do not send the current running version of 2ping with each packet. --notice=text Arbitrary notice text to send with each packet. If the remote peer supports it, this may be displayed to the user. --packet-loss=out:in Simulate random packet loss outbound and inbound. For example, 25:10 means a 25% chance of not sending a packet, and a 10% chance of ignoring a received packet. A single number without colon separation means use the same percentage for both outbound and inbound. --port=port Use UDP port port. With --listen, this is the port to bind as, otherwise this is the port to send to. Default is UDP port 15998. --stats=interval Print a line of brief current statistics every interval seconds. The same line can be printed on demand by sending SIGQUIT to the 2ping process. BUGS
There are probably lots and lots and lots of unknown bugs. By default, source IP logic doesn't work as expected, see -I for details. There appears to be no way to peg the source IP of reply UDP packets to the destination of the packet that is being replied to. As a result, packets always go out the interface's main IP address if not specified manually. (Please, prove the author wrong.) This manpage isn't finished yet, and may never be. AUTHOR
2ping was written by Ryan Finnie <ryan@finnie.org>. 2012-04-22 2PING(8)
All times are GMT -4. The time now is 08:49 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy