[ALUG] What's a fast way to check for something on LAN?

Chris Green cl at isbd.net
Wed Feb 22 17:01:00 GMT 2017


On Wed, Feb 22, 2017 at 04:34:37PM +0000, Simon Ransome wrote:
> Chris,
> 
> This does it in exactly one second, if that's any use:
> 
> ping -c1 n.n.n.n -w1
> 
> (just look for "100% packet loss" in the output).
> 
> You're probably looking at implementing something using an ICMP library to
> get any faster.
> 
Excellent, thank you, what a nice simple solution. I use ping's exit
value to decide whether the system is there on not.

By the way everyone I was just trying this out and realised that the
delay I was originally finding annoying was 10 seconds rather than
just 3.  A one second delay is fine.

-- 
Chris Green



More information about the main mailing list