fping - send ICMP ECHO_REQUEST packets to network hosts

     fping [ options ] [ systems... ]


     fping is a	ping(8)	like program which uses	the Internet Control Message
     Protocol (ICMP) echo request to determine if a host is up.	fping is dif-
     ferent from ping in that you can specify any number of hosts on the com-
     mand line,	or specify a file containing the lists of hosts	to ping.
     Instead of	trying one host	until it timeouts or replies, fping will send
     out a ping	packet and move	on to the next host in a round-robin fashion.
     If	a host replies,	it is noted and	removed	from the list of hosts to
     check. If a host does not respond within a	certain	time limit and/or
     retry limit it will be considered unreachable.

     Unlike ping(8) , fping is meant to	be used	in scripts and its output is
     easy to parse.


     -a	  Show systems that are	alive.

     -d	  Use DNS to lookup address of return ping packet. This	allows you to
	  give fping a list of IP addresses as input and print hostnames in
	  the output.

     -e	  Show elapsed (round-trip) time of packets

     -f	  Read list of system from a file. This option can only be used by 
	  the root user.  Regular users should pipe in the file via stdin:
              fping < targets_file

     -g   Generate a target list from a supplied IP netmask, or a starting 
	  and ending IP. Specify the netmask or start/end in the targets 
	  portion of the command line.

              ex. To ping the class C 192.168.1.x, the specified command 
		  line could look like either:

              fping -g


              fping -g

     -in  The minimum amount of	time (in milliseconds) between sending a ping
	  packet to any	host (default is 10).

     -q	  Quiet. Don't show per	host results, just set final exit status.

     -rn  Retry	limit (default 3). This	is the number of times an attempt at
	  pinging a host will be made, not including the first try.

     -s	  Dump final statistics.

     -tn  Individual host timeout in milliseconds (default 2500). This is the
	  minimum number of milliseconds between ping packets directed
	  towards a given host.

     -u	  Show systems that are	unreachable.  fping a list of IP addresses as
	  input	and have the results printed as	hostnames.



     The following perl	script will check a list of hosts and send mail	if
     any are unreachable. It uses the open2 function which allows a program
     to	be opened for reading and writing. fping does not start	pinging	the
     list of systems until it reads EOF, which it gets after INPUT is closed.
     Sure the open2 usage is not need in this example, but its a good open2
     example none the less.

     require 'open2.pl';

     $MAILTO = "root";

     $pid = &open2("OUTPUT","INPUT","/usr/local/bin/fping -u");


     foreach(@check) {	print INPUT "$_\n"; }

     if	($#output != -1) {
      open(MAIL,"|mail -s 'unreachable systems'	$MAILTO");
      print MAIL "\nThe	following systems are unreachable as of: $date\n\n";
      print MAIL @output;
      close MAIL;

     Another good example is when you want to perform an action	only on	hosts
     that are currently	reachable.


     $hosts_to_backup =	`cat /etc/hosts.backup | fping -a`;

     foreach $host (split(/\n/,$hosts_to_backup)) {
       # do it

     Roland J. Schemers III, Stanford University, concept and versions 1.x
     RL "Bob" Morgan, Stanford University, versions 2.x
     ZeroHype Technologies Inc. (http://www.zerohype.com), versions 2.3x
     fping website:  http://www.fping.com

     Exit status is 0 if all the hosts are reachable, 1	if some	hosts were
     unreachable, 2 if any IP addresses	were not found,	3 for invalid command
     line arguments, and 4 for a system	call failure.

     Ha! If there were any I knew of I would have fixed	them!



     If	certain	options	are used (i.e, a low value for -i and -t, and a	high
     value for -r) it is possible to flood the network.	This program must be
     installed as setuid root in order to open up a raw	socket,	or must	be
     run by root. In order to stop mere	mortals	from hosing the	network	(when
     fping is installed	setuid root) , normal users can't specify the follow-

      -i n   where n < 10  msec
      -r n   where n > 20
      -t n   where n < 250 msec

     netstat(1), ping(8), ifconfig(8c)