I've found fping -r0 ...
to provide the fastest response.
The -r
(retry) option seems faster than the similar -c
(count). Using -r0
results in just one ping being sent and the output is much abbreviated compared to other options.
On my system...
fping -r0 PRINTER LX00 LX01 LX02 LX03 HA01 2>&1
Results in...
LX00 is alive
LX02 is alive
HA01 is alive
ICMP Host Unreachable from 192.168.1.5 for ICMP Echo sent to LX01
PRINTER is unreachable
LX01 is unreachable
LX03 is unreachable
A little massaging to get rid of the ICMP
message(s) gives me...
fping -r0 PRINTER LX00 LX01 LX02 LX03 HA01 2>&1 | grep ' is ' | sort
HA01 is alive
LX00 is alive
LX01 is unreachable
LX02 is alive
LX03 is unreachable
PRINTER is unreachable
As for speed, the fping
on this old 1.8GHz Intel Dual-Core with 4GB RAM is...
time fping -r0 PRINTER LX00 LX01 LX02 LX03 HA01 2>&1
LX00 is alive
LX02 is alive
HA01 is alive
PRINTER is unreachable
LX01 is unreachable
LX03 is unreachable
real 0m0.554s
user 0m0.000s
sys 0m0.000s
And the grep
and sort
seem to only add 0.001-0.004s to the time...
time fping -r0 PRINTER LX00 LX01 LX02 LX03 HA01 2>&1 | grep ' is ' | sort
HA01 is alive
LX00 is alive
LX01 is unreachable
LX02 is alive
LX03 is unreachable
PRINTER is unreachable
real 0m0.558s
user 0m0.000s
sys 0m0.000s
NOTES
- The
ICMP
message doesn't occur on every run.
- The
2>&1
is necessary to prevent the ICMP
message from
showing up in the output as it is sent to stderr
instead of stdout
.