I need a tool that tells me if a connection to a host is open or not - no data to send or receive. Just if the connect is successful.
Today I use telnet.
$ telnet myhost myport
Trying 192.168.1.99...
Connected to myhost.
Escape character is '^]'.
^[^]
telnet> quit
Connection closed.
But I need to have manual input there. ^] and then also the quit.
I need to check several hosts and that is too much for that.
Any tool out there that does the trick?
If not I need to write 15 lines in perl - whats is ok but I would prefer an existing tool.
perl -MIO::Socket::IP -e 'IO::Socket::IP->new(PeerAddr => $ARGV[0], Timeout => 5) or die $!' host:port
. For several hosts just put a loop around itping -c3 IP_addr
, and parse the error stream.