He encontrado fping -r0 ...para proporcionar la respuesta más rápida.
La -ropción (reintentar) parece más rápida que la similar -c(cuenta). El uso de -r0resultados solo se envía un ping y la salida se abrevia mucho en comparación con otras opciones.
En mi sistema ...
fping -r0 PRINTER LX00 LX01 LX02 LX03 HA01 2>&1
Resultados en ...
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
Un poco de masaje para deshacerme de los ICMPmensajes me da ...
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
En cuanto a la velocidad, fpingen este viejo Intel Dual-Core de 1.8GHz con 4GB de RAM es ...
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
Y el grepy sortparece agregar solo 0.001-0.004s al tiempo ...
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
NOTAS
- El
ICMPmensaje no aparece en cada ejecución.
- El
2>&1es necesaria para evitar que el ICMPmensaje de
aparecer en la salida, ya que se envía al stderrlugar de stdout.