DESCRIPTION

This draws a sonar screen that pings (get it?) the hosts on your local
network, and plots their distance (response time) from you. The three
rings represent ping times of approximately 2.5, 70 and 2,000
milliseconds respectively.
Alternately, it can run a simulation that doesn’t involve hosts.

OPTIONS

sonar understands the following options:
-pinghosts-or-subnets
The list of things to ping, separated by commas or spaces.
Elements of this list may be:
simulation Run in simulation mode instead of pinging real
hosts.
hostname Ping the given host.
A.B.C.D Ping the given IP address.
subnet Ping the local class C subnet (the nearest 255
addresses).
subnet/NN Ping a different-sized local subnet: e.g.,
subnet/28 would ping a 4-bit subnet (the nearest 15
addresses).
A.B.C.D/NN Ping an arbitrary other subnet. The IP address
specifies the base address, and the part after the
slash is how wide the subnet is. Typical values
are /24 (for 255 addresses) and /28 (for 15
addresses).
filename Ping the hosts listed in the given file. This file
can be in the format used by /etc/hosts, or it can
be any file that has host names as the first or
second element on each line. If you use ssh, try
this:
sonar -ping $HOME/.ssh/known_hosts
-ping-timeoutint
The amount of time in milliseconds the program will wait for an
answer to a ping.
-delayint
Delay between frames, in microseconds. Default 20000.
-speedratio
Less than 1 for slower, greater than 1 for faster. Default 1.
-sweep-sizeratio
How big the glowing sweep area should be. Default 0.3.
-font-sizepoints
How large the text should be. Default 10 points.
-no-wobble
Keep the display stationary instead of very slowly wobbling
back and forth.
-no-dns Do not attempt to resolve IP addresses to hostnames.
-no-times
Do not display ping times beneath the host names.
-team-a-namestring
In simulation mode, the name of team A.
-team-b-namestring
In simulation mode, the name of team B.
-team-a-countint
In simulation mode, the number of bogies on team A.
-team-b-countint
In simulation mode, the number of bogies on team B.
-fps Display the current frame rate, polygon count, and CPU load.

NOTES

On most Unix systems, this program must be installed as setuid root in
order to ping hosts. This is because root privileges are needed to
create an ICMP RAW socket. Privileges are disavowed shortly after
startup (just after connecting to the X server) so this is believed to
be safe:
chown root:root sonar
chmod u+s sonar
It is not necessary to make it setuid on MacOS systems, because on
MacOS, unprivileged programs can ping by using ICMP DGRAM sockets
instead of ICMP RAW.
In ping-mode, the display is a logarithmic scale, calibrated so that
the three rings represent ping times of approximately 2.5, 70 and 2,000
milliseconds respectively.
This means that if any the hosts you are pinging take longer than 2
seconds to respond, they won’t show up; and if you are pinging several
hosts with very fast response times, they will all appear close to the
center of the screen (making their names hard to read.)