I'm aware of the methods where you can run a Bash for
loop and ping
multiple servers, is there a Linux CLI tool that I can use which will allow for me to do this without having to resort to writing a Bash script to ping
a list of servers one at a time?
Something like this:
$ ping host1 host2 host3
NOTE: I'm looking specifically for CentOS/Fedora, but if it works on other distros that's fine too.
Best Answer
If you look into the NMAP project you'll find that it includes additional tools on top of just
nmap
. One of these tools isnping
, which includes the following ability:nping
is in the standard EPEL repos to boot.Usage
To ping multiple servers you merely have to tell
nping
the names/IPs and which protocol you want to use. Here since we want to mimic what the traditionalping
CLI does we'll use ICMP.The only drawback I've found with this tool is the use of ICMP mode requiring root privileges.