1fping(l)                                                              fping(l)
2
3
4

NAME

6       fping - send ICMP ECHO_REQUEST packets to network hosts
7

SYNOPSIS

9       fping [ options ] [ systems... ]
10
11

DESCRIPTION

13       fping  is a like program which uses the Internet Control Message Proto‐
14       col (ICMP) echo request to determine if a target  host  is  responding.
15       fping  differs  from ping in that you can specify any number of targets
16       on the command line, or specify a file containing the lists of  targets
17       to  ping.  Instead  of  sending  to  one  target  until it times out or
18       replies, fping will send out a ping packet and move on to the next tar‐
19       get in a round-robin fashion.
20
21       In  the default mode, if a target replies, it is noted and removed from
22       the list of targets to check; if a target does  not  respond  within  a
23       certain  time limit and/or retry limit it is designated as unreachable.
24       fping also supports sending a specified number of pings to a target, or
25       looping indefinitely (as in ping ).
26
27       Unlike  ping  ,  fping is meant to be used in scripts, so its output is
28       designed to be easy to parse.
29

OPTIONS

31       -a   Show systems that are alive.
32
33       -A   Display targets by address rather than DNS name.
34
35       -bn  Number of bytes of ping data to send.  The minimum size  (normally
36            12)  allows  room  for  the  data  that fping needs to do its work
37            (sequence number, timestamp).  The  reported  received  data  size
38            includes  the  IP  header  (normally  20 bytes) and ICMP header (8
39            bytes), so the minimum total size is 40 bytes.  Default is 56,  as
40            in  ping.   Maximum  is  the  theoretical maximum IP datagram size
41            (64K), though most systems limit this to a smaller,  system-depen‐
42            dent number.
43
44       -Bn  In  the  default  mode,  fping  sends several requests to a target
45            before giving up, waiting longer for a reply  on  each  successive
46            request.   This  parameter  is the value by which the wait time is
47            multiplied on each successive request; it must  be  entered  as  a
48            floating-point number (x.y).  The default is 1.5.
49
50       -c   Number of request packets to send to each target.  In this mode, a
51            line is displayed for each received response (this can  suppressed
52            with  -q or -Q).  Also, statistics about responses for each target
53            are displayed when all requests have been  sent  (or  when  inter‐
54            rupted).
55
56       -C   Similar  to  -c,  but the per-target statistics are displayed in a
57            format designed for automated response-time statistics  gathering.
58            For example:
59
60            % fping -C 5 -q somehost
61
62            somehost : 91.7 37.0 29.2 - 36.8
63
64            shows  the  response  time  in  milliseconds  for each of the five
65            requests, with the "-" indicating that no response was received to
66            the fourth request.
67
68       -d   Use  DNS  to lookup address of return ping packet. This allows you
69            to give fping a list of IP addresses as input and print  hostnames
70            in the output.
71
72       -e   Show elapsed (round-trip) time of packets.
73
74       -f   Read list of targets from a file.  This option can only be used by
75            the root user.  Regular users should pipe in the file via stdin:
76
77            % fping < targets_file
78
79
80       -g   Generate a target list from a supplied IP netmask, or  a  starting
81            and  ending  IP.   Specify the netmask or start/end in the targets
82            portion of the command line.
83
84            ex. To ping the class C 192.168.1.x, the  specified  command  line
85            could look like either:
86
87            fping -g 192.168.1.0/24
88
89            or
90
91            fping -g 192.168.1.0 192.168.1.255
92
93       -h   Print usage message.
94
95       -in  The  minimum  amount  of  time (in milliseconds) between sending a
96            ping packet to any target (default is 25).
97
98       -l   Loop sending packets to each target indefinitely.  Can  be  inter‐
99            rupted  with ctl-C; statistics about responses for each target are
100            then displayed.
101
102       -m   Send pings to each of a target host's multiple interfaces.
103
104       -n   Same as -d.
105
106       -p   In looping or counting modes (-l, -c, or -C), this parameter  sets
107            the time in milliseconds that fping waits between successive pack‐
108            ets to an individual target.  Default is 1000.
109
110       -q   Quiet. Don't show per-target results, just set final exit status.
111
112       -Qn  Like -q, but show summary results every n seconds.
113
114       -rn  Retry limit (default 3). This is the number of times an attempt at
115            pinging a target will be made, not including the first try.
116
117       -s   Print cumulative statistics upon exit.
118
119       -tn  Initial  target  timeout  in  milliseconds  (default  500). In the
120            default mode, this is the amount of time that fping  waits  for  a
121            response to its first request.  Successive timeouts are multiplied
122            by the backoff factor.
123
124       -u   Show targets that are unreachable.
125
126       -v   Print fping version information.
127
128

EXAMPLES

130       The following perl script will check a list of hosts and send  mail  if
131       any  are unreachable. It uses the open2 function which allows a program
132       to be opened for reading and writing. fping does not start pinging  the
133       list  of  systems  until  it  reads  EOF,  which it gets after INPUT is
134       closed.  Sure the open2 usage is not needed in this example, but it's a
135       good open2 example none the less.
136
137       #!/usr/local/bin/perl
138       require 'open2.pl';
139
140       $MAILTO = "root";
141
142       $pid = &open2("OUTPUT","INPUT","/usr/local/bin/fping -u");
143
144       @check=("slapshot","foo","foobar");
145
146       foreach(@check) {  print INPUT "$_\n"; }
147       close(INPUT);
148       @output=<OUTPUT>;
149
150       if ($#output != -1) {
151        chop($date=`date`);
152        open(MAIL,"|mail -s 'unreachable systems' $MAILTO");
153        print MAIL "\nThe following systems are unreachable as of: $date\n\n";
154        print MAIL @output;
155        close MAIL;
156       }
157
158       Another good example is when you want to perform an action only on hosts
159       that are currently reachable.
160
161       #!/usr/local/bin/perl
162
163       $hosts_to_backup = `cat /etc/hosts.backup | fping -a`;
164
165       foreach $host (split(/\n/,$hosts_to_backup)) {
166         # do it
167       }
168
169
170

AUTHORS

172       Roland J. Schemers III, Stanford University, concept and versions 1.x
173       RL "Bob" Morgan, Stanford University, versions 2.x
174       David Papp, versions 2.3x and up,
175       fping website:  http://www.fping.com
176

DIAGNOSTICS

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

BUGS

183       Ha! If we knew of any we would have fixed them!
184

RESTRICTIONS

186       If certain options are used (i.e, a low value for -i and -t, and a high
187       value for -r) it is possible to flood the network. This program must be
188       installed  as  setuid root in order to open up a raw socket, or must be
189       run by root. In order to stop mere  mortals  from  hosing  the  network
190       (when  fping is installed setuid root) , normal users can't specify the
191       following:
192
193        -i n   where n < 10  msec
194        -r n   where n > 20
195        -t n   where n < 250 msec
196
197

SEE ALSO

199       netstat(1), ping(8), ifconfig(8c)
200
201
202
203
204                                                                      fping(l)
Impressum