LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   Terminal doesn't display failed pings, only successful ones (Debian Lenny) (http://www.linuxquestions.org/questions/linux-software-2/terminal-doesnt-display-failed-pings-only-successful-ones-debian-lenny-832378/)

wolverene13 09-15-2010 02:32 PM

Terminal doesn't display failed pings, only successful ones (Debian Lenny)
 
Hi all,

I am running Debian Lenny and just upgraded via "apt-get upgrade" yesterday and all appears to be fine, except I noticed that when I ping something from a terminal window, it only displays successful pings and does not show the failed ones. When the pings fail, I have to "Ctrl-C" to see the results and cannot see them in real-time. It's not a huge problem, but I'd still like to be able to see immediate results even when pings fail.

Example is below:

(Username and host name changed to protect the innocent; or due to being overly paranoid, whichever).

Successful -

foo@bar:~$ ping 4.2.2.2
PING 4.2.2.2 (4.2.2.2) 56(84) bytes of data.
64 bytes from 4.2.2.2: icmp_req=1 ttl=56 time=20.6 ms
64 bytes from 4.2.2.2: icmp_req=2 ttl=56 time=17.5 ms
64 bytes from 4.2.2.2: icmp_req=3 ttl=56 time=18.4 ms
64 bytes from 4.2.2.2: icmp_req=4 ttl=56 time=17.3 ms
64 bytes from 4.2.2.2: icmp_req=5 ttl=56 time=18.2 ms
64 bytes from 4.2.2.2: icmp_req=6 ttl=56 time=16.5 ms
^C
--- 4.2.2.2 ping statistics ---
6 packets transmitted, 6 received, 0% packet loss, time 5007ms
rtt min/avg/max/mdev = 16.506/18.116/20.630/1.281 ms

Failed -

foo@bar:~$ ping 159.53.64.105
PING 159.53.64.105 (159.53.64.105) 56(84) bytes of data.
^C
--- 159.53.64.105 ping statistics ---
5 packets transmitted, 0 received, 100% packet loss, time 4032ms

I tried searching Google with numerous search strings and tried searching this site extensively, but I come up with nothing.

Any ideas?

Thanks in advance.

14moose 09-15-2010 02:43 PM

"Learn patience, must you, Young Grasshopper" ;)

As you know, "ping" won't give up immediately ... unless you hit Ctl-C. This is Correct Behavior.

However, many (most?) implementations of ping have some kind of "timeout" parameter (e.g. "-w SECONDS"):

http://linux.about.com/od/commands/l/blcmdl8_ping.htm

'Hope that helps

wolverene13 09-15-2010 02:48 PM

Quote:

Originally Posted by 14moose (Post 4098535)
"Learn patience, must you, Young Grasshopper" ;)

As you know, "ping" won't give up immediately ... unless you hit Ctl-C. This is Correct Behavior.

However, many (most?) implementations of ping have some kind of "timeout" parameter (e.g. "-w SECONDS"):

http://linux.about.com/od/commands/l/blcmdl8_ping.htm

'Hope that helps

But if you'll notice, it says there were five failed pings. It's not a scenario wherein Debian was still waiting for the first echo reply and I interrupted it with "Ctrl-C." Shouldn't I have seen 5 lines of "Destination host unreachable"? That's what it used to do before the upgrade.

14moose 09-15-2010 04:23 PM

Hi -

There are potentially a couple of different issues here:

1. The behavior of the "old Debian" vs. the "new Debian"
<= I can't help you here :)

2. Whether or not you'll ever get a "failed" message, or whether it'll just hang forever
<= I (mistakenly?) thought this was *the* problem

3. Whether the problem is ICMP (the "ping") or DNS (a hang trying to resolve the name you're trying to "ping" to).

The problem could definitely be DNS even if you're ping'ing a raw IP address.

4. Who knows - the problem might even be something weirdly off-base like SeLinux or IPV6.

SUGGESTIONS:
1. Try ping with a timeout (e.g. "-w SEC") and see if it behaves differently

2. Try a bogus address and see if it behaves differently

3. "Pull the plug", try pinging a local machine (with the network cable unplugged) and see if it behaves differently

PS:
Is "Wolverine" an hommage to the Stan Lee/"X Men" character, the 1980's John Milius movie "Red Dawn", or something else altogether?

wolverene13 09-21-2010 07:13 AM

Quote:

Originally Posted by 14moose (Post 4098641)
Hi -

There are potentially a couple of different issues here:

1. The behavior of the "old Debian" vs. the "new Debian"
<= I can't help you here :)

2. Whether or not you'll ever get a "failed" message, or whether it'll just hang forever
<= I (mistakenly?) thought this was *the* problem

3. Whether the problem is ICMP (the "ping") or DNS (a hang trying to resolve the name you're trying to "ping" to).

The problem could definitely be DNS even if you're ping'ing a raw IP address.

4. Who knows - the problem might even be something weirdly off-base like SeLinux or IPV6.

SUGGESTIONS:
1. Try ping with a timeout (e.g. "-w SEC") and see if it behaves differently

2. Try a bogus address and see if it behaves differently

3. "Pull the plug", try pinging a local machine (with the network cable unplugged) and see if it behaves differently

PS:
Is "Wolverine" an hommage to the Stan Lee/"X Men" character, the 1980's John Milius movie "Red Dawn", or something else altogether?

1.) With a timeout: no change.

foo@bar:~$ ping -t 100 4.2.2.2
PING 4.2.2.2 (4.2.2.2) 56(84) bytes of data.
64 bytes from 4.2.2.2: icmp_req=1 ttl=56 time=19.4 ms
64 bytes from 4.2.2.2: icmp_req=2 ttl=56 time=17.9 ms
64 bytes from 4.2.2.2: icmp_req=3 ttl=56 time=17.7 ms
64 bytes from 4.2.2.2: icmp_req=4 ttl=56 time=17.4 ms
^C
--- 4.2.2.2 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3004ms
rtt min/avg/max/mdev = 17.469/18.177/19.466/0.777 ms

foo@bar:~$ ping -t 100 1.1.1.1
PING 1.1.1.1 (1.1.1.1) 56(84) bytes of data.
^C
--- 1.1.1.1 ping statistics ---
6 packets transmitted, 0 received, 100% packet loss, time 5024ms

foo@bar:~$

2.) No difference when pinging a bogus address

foo@bar:~$ ping 169.1.1.1
PING 169.1.1.1 (169.1.1.1) 56(84) bytes of data.
^C
--- 169.1.1.1 ping statistics ---
4 packets transmitted, 0 received, 100% packet loss, time 3024ms

foo@bar:~$

3.) Same thing when pulling the plug

foo@bar:~$ ping 10.10.10.1
PING 10.10.10.1 (10.10.10.1) 56(84) bytes of data.
^C
--- 10.10.10.1 ping statistics ---
4 packets transmitted, 0 received, 100% packet loss, time 3024ms

foo@bar:~$

-----P.S. - I think you're the first person ever to get the Red Dawn reference. However, I had to spell it with an "e" instead of an "i" because someone already had "wolverine", so everyone thinks it's misspelled.

wolverene13 09-29-2010 02:24 PM

Bump
 
Bump

theplen 05-10-2011 10:08 AM

I think you are looking for "ping -v" the "-v" turns on verbose which will show you failed pings.

Edit: I thought that did it, but it doesn't so if anyone else knows the answer, I would like to know it too.

sunveer 10-17-2012 09:57 AM

I too experienced the same issue.

Failed ping doesn't display the output like what is the reason like Destination Host Unreachable.

However, successful pings shows output.

I tried all the options even the verbose -v but no success.

idogan 10-08-2013 06:06 AM

Quote:

Originally Posted by sunveer (Post 4808153)
I too experienced the same issue.

Failed ping doesn't display the output like what is the reason like Destination Host Unreachable.

However, successful pings shows output.

I tried all the options even the verbose -v but no success.

+1
I have also same experience.
I never see dropped pings on the real time ping output!
I think this is a really very big missing. It should be there as optional.

thelukester 01-28-2014 09:08 PM

I also need to be able to see failed pings in real-time. Has anyone come up with a fix for this?

Habitual 01-29-2014 08:42 AM

Is there an alias for ping that could be causing this behavior, possibly?
Terminal >
Code:

type -f ping
Either you'll get
ping is aliased to ...
or
ping is /bin/ping (or bin/path may vary)

If it is aliased, just type
Code:

unalias ping
In the meantime, try this:
Code:

ping -c1 -w1 159.53.64.105
which shows me the results much faster vs. a "regular" ping which does seem to not show any results.

Please let us know


All times are GMT -5. The time now is 04:52 PM.