DESCRIPTION

The sonar program displays a sonar scope on the computer’s screen.
This scope polls a sensor as the sweep goes around the scope and
displays what it finds as bogies on the screen. The program is
designed to support different modes representing different types of
sensors. Currently the only implemented sensors are a simulator, and a
network ping function that pings hosts and plots the results on the
scope.

OPTIONS

sonar understands the following options:
-backgroundColor
The background Color of the screen not covered by the scope.
-sweep-colorColor
The color of the brightest part of the sweep.
-scope-colorColor
The color of the circular part of the scope.
-grid-colorColor
The color to the grid lines overlaying the scope.
-text-colorColor
The color of the text identifying bogies on the scope.
-ttlinteger
"Time to live": visible time of a Bogie. Try values between 10
(very short) and 100.
-fontfont
The font used to display text on the scope. Default "fixed".
-ping-timeoutint
The amount of time in milliseconds the program will wait for an
answer to a ping.
-pinghosts-or-subnets
The list of things to ping, separated by commas or spaces.
Elements of this list may be:
simulation to run in simulation mode, instead of pinging real
hosts (this is the default if the program is not
installed setuid);
hostname to ping the given host;
A.B.C.D to ping the given IP address;
subnet to ping the local class C subnet (the nearest 255
addresses);
subnet/NN to 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 to 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 to 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
element on each line. If you use ssh, try this:
sonar -ping $HOME/.ssh/known_hosts
-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 and CPU load.

NOTES

In order to use the ping sensor on most systems, this program must be
installed as setuid root, so that it can create an ICMP RAW socket.
Root privileges are disavowed shortly after startup (just after
connecting to the X server and reading the resource database) so this
is believed to be a safe thing to do, but it is usually recommended
that you have as few setuid programs around as possible, on general
principles.
chown root:root sonar
chmod u+s sonar
It is not necessary to make it setuid on MacOS systems, because on
those systems, 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.)