Bug 105678

Summary: ping's exit code could be more useful
Product: [Retired] Red Hat Linux Reporter: Adam Spiers <redhat>
Component: iputilsAssignee: Phil Knirsch <pknirsch>
Status: CLOSED NOTABUG QA Contact: Mike McLean <mikem>
Severity: medium Docs Contact:
Priority: low    
Version: 9CC: rvokal
Target Milestone: ---Keywords: FutureFeature
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-04-22 13:17:57 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Adam Spiers 2003-09-26 14:46:04 UTC
If you specify both -c and -w switches, and the exit
code is 1, you don't know whether the host is alive
or not just by the exit code, since either no reply
packets have been received, or some reply packets *were*
recieved but the program timed out before the *full*
quota of packets expected in the -c value were received
(e.g. with -c 5 any number of replies between 1 and 4
would result in an exit code of 1).

That means that you have to look at STDOUT to determine
whether a host was alive, which makes scripting etc.
a lot more awkward.

Comment 1 Phil Knirsch 2004-04-22 13:17:57 UTC
Why don't you use -c 1 -W 10 for example then? This should do what you
want as if it fails then the host was not reachable, otherwise it was
reachable.

Read ya, Phil