Install fping on Raspberry Pi

Install fping on Raspberry Pi

The fping is a command line tool that allows to send ICMP echo requests to the network hosts to determine if a host is reachable. The fping is similar to the ping command, except fping can accept any number of hosts which provided as command line arguments. The fping also can read hosts from a text file.

This tutorial explains how to install fping on Raspberry Pi.

Use SSH to connect to Raspberry Pi. Run the following commands to update the package lists and install fping:

sudo apt update
sudo apt install -y fping

We can check fping version:

fping --version

Now we can test. Run the fping command and provide the hosts as arguments in order to ping hosts:

fping -c 3 google.com youtube.com

We will get the output similar to the following:

google.com  : [0], 84 bytes, 24.4 ms (24.4 avg, 0% loss)
youtube.com : [0], 84 bytes, 24.7 ms (24.7 avg, 0% loss)
google.com  : [1], 84 bytes, 27.2 ms (25.8 avg, 0% loss)
youtube.com : [1], 84 bytes, 24.5 ms (24.6 avg, 0% loss)
google.com  : [2], 84 bytes, 26.6 ms (26.1 avg, 0% loss)
youtube.com : [2], 84 bytes, 27.0 ms (25.4 avg, 0% loss)

google.com  : xmt/rcv/%loss = 3/3/0%, min/avg/max = 24.4/26.1/27.2
youtube.com : xmt/rcv/%loss = 3/3/0%, min/avg/max = 24.5/25.4/27.0

The -c option defines the number of requests to be sent to each host.

We can use -f option to specify a text file that contains a list of hosts:

printf "google.com\nyoutube.com" > test.txt

fping -c 3 -f test.txt

If you wish to completely remove fping, execute the following command:

sudo apt purge --autoremove -y fping

Leave a Comment

Cancel reply

Your email address will not be published.