Merge pull request #5 from xtaran/master

Typo and man-page fixups
pull/8/head
David Schweikert 13 years ago
commit 19b041904b

@ -1,228 +1,223 @@
.TH fping 8 .TH fping 8
.SH NAME .SH NAME
fping \- send ICMP ECHO_REQUEST packets to network hosts fping \- send ICMP ECHO_REQUEST packets to network hosts
.SH SYNOPSIS .SH SYNOPSIS
.B fping .B fping
[ \fIoptions\fR ] [ \fIoptions\fR ]
[ \fIsystems...\fR ] [ \fIsystems...\fR ]
.SH DESCRIPTION .SH DESCRIPTION
.NXR "fping command" .B fping
.NXR "ICMP ECHO_REQUEST" is a program like
.B ping(8)
which uses the Internet Control
.B fping Message Protocol (ICMP) echo request to determine if a target host is
is a program like responding.
.B ping(8) .B fping
which uses the Internet Control differs from ping in that you can specify any
Message Protocol (ICMP) echo request to determine if a target host is number of targets on the command line, or specify a file containing
responding. the lists of targets to ping. Instead of sending to one target until it
.B fping times out or replies,
differs from ping in that you can specify any .B fping
number of targets on the command line, or specify a file containing will send out a ping packet and move
the lists of targets to ping. Instead of sending to one target until it on to the next target in a round-robin fashion.
times out or replies, .PP
.B fping In the default mode, if a target replies,
will send out a ping packet and move it is noted and removed from the list of targets to check; if a target
on to the next target in a round-robin fashion. does not respond within a certain time limit and/or retry limit it
.PP is designated as unreachable.
In the default mode, if a target replies, .B fping
it is noted and removed from the list of targets to check; if a target also supports sending a specified number of pings to a target, or
does not respond within a certain time limit and/or retry limit it looping indefinitely (as in
is designated as unreachable. .B ping
.B fping ).
also supports sending a specified number of pings to a target, or .PP
looping indefinitely (as in Unlike
.B ping .B ping,
). .B fping
.PP is meant to be used in scripts, so its output is designed to be
Unlike easy to parse.
.B ping, .SH OPTIONS
.B fping .IP \fB\-a\fR 5
is meant to be used in scripts, so its output is designed to be Show systems that are alive.
easy to parse. .IP \fB\-A\fR 5
.SH OPTIONS Display targets by address rather than DNS name.
.IP \fB-a\fR 5 .IP \fB\-b\fIn\fR 5
Show systems that are alive. Number of bytes of ping data to send. The minimum size (normally 12)
.IP \fB-A\fR 5 allows room for the data that
Display targets by address rather than DNS name. .B fping
.IP \fB-b\fIn\fR 5 needs to do its work (sequence number, timestamp). The reported
Number of bytes of ping data to send. The minimum size (normally 12) received data size includes the IP header (normally 20 bytes) and ICMP
allows room for the data that header (8 bytes), so the minimum total size is 40 bytes. Default is
.B fping 56, as in
needs to do its work (sequence number, timestamp). The reported .B ping.
received data size includes the IP header (normally 20 bytes) and ICMP Maximum is the theoretical maximum IP datagram size (64K), though most
header (8 bytes), so the minimum total size is 40 bytes. Default is systems limit this to a smaller, system-dependent number.
56, as in .IP \fB\-B\fIn\fR 5
.B ping. In the default mode,
Maximum is the theoretical maximum IP datagram size (64K), though most .B fping
systems limit this to a smaller, system-dependent number. sends several requests to a target before giving up, waiting longer for
.IP \fB-B\fIn\fR 5 a reply on each successive request. This parameter is the value by
In the default mode, which the wait time is multiplied on each successive request; it must
.B fping be entered as a floating-point number (x.y). The default is 1.5.
sends several requests to a target before giving up, waiting longer for .IP \fB\-c\fR 5
a reply on each successive request. This parameter is the value by Number of request packets to send to each target. In this mode, a
which the wait time is multiplied on each successive request; it must line is displayed for each received response (this can suppressed with
be entered as a floating-point number (x.y). The default is 1.5. \-q or \-Q). Also, statistics about responses for each target are displayed
.IP \fB-c\fR 5 when all requests have been sent (or when interrupted).
Number of request packets to send to each target. In this mode, a .IP \fB-C\fR 5
line is displayed for each received response (this can suppressed with Similar to \-c, but the per-target statistics are displayed in a format
-q or -Q). Also, statistics about responses for each target are displayed designed for automated response-time statistics gathering. For
when all requests have been sent (or when interrupted). example:
.IP \fB-C\fR 5
Similar to -c, but the per-target statistics are displayed in a format % fping \-C 5 \-q somehost
designed for automated response-time statistics gathering. For
example: somehost : 91.7 37.0 29.2 \- 36.8
% fping -C 5 -q somehost shows the response time in milliseconds for each of the five requests,
with the "\-" indicating that no response was received to the fourth
somehost : 91.7 37.0 29.2 - 36.8 request.
.IP \fB\-d\fR 5
shows the response time in milliseconds for each of the five requests, Use DNS to lookup address of return ping packet. This allows you to give
with the "-" indicating that no response was received to the fourth fping a list of IP addresses as input and print hostnames in the output.
request. .IP \fB\-e\fR 5
.IP \fB-d\fR 5 Show elapsed (round-trip) time of packets.
Use DNS to lookup address of return ping packet. This allows you to give .IP \fB\-f\fR 5
fping a list of IP addresses as input and print hostnames in the output. Read list of targets from a file. This option can only be used by the
.IP \fB-e\fR 5 root user. Regular users should pipe in the file via stdin:
Show elapsed (round-trip) time of packets.
.IP \fB-f\fR 5 % fping < targets_file
Read list of targets from a file. This option can only be used by the
root user. Regular users should pipe in the file via stdin: .IP \fB\-g\fR 5
Generate a target list from a supplied IP netmask, or a starting and ending IP.
% fping < targets_file Specify the netmask or start/end in the targets portion of the command line.
.IP \fB-g\fR 5 ex. To ping the class C 192.168.1.x, the specified command line could look like either:
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. fping \-g 192.168.1.0/24
ex. To ping the class C 192.168.1.x, the specified command line could look like either: or
fping -g 192.168.1.0/24 fping -g 192.168.1.0 192.168.1.255
.IP \fB\-h\fR 5
or Print usage message.
.IP \fB\-i\fIn\fR 5
fping -g 192.168.1.0 192.168.1.255 The minimum amount of time (in milliseconds) between sending a ping packet to any target (default is 25).
.IP \fB-h\fR 5 .IP \fB\-l\fR 5
Print usage message. Loop sending packets to each target indefinitely. Can be interrupted
.IP \fB-i\fIn\fR 5 with Ctrl-C; statistics about responses for each target are then displayed.
The minimum amount of time (in milliseconds) between sending a ping packet to any target (default is 25). .IP \fB\-m\fR 5
.IP \fB-l\fR 5 Send pings to each of a target host's multiple interfaces.
Loop sending packets to each target indefinitely. Can be interrupted .IP \fB\-n\fR 5
with ctl-C; statistics about responses for each target are then displayed. Same as \-d.
.IP \fB-m\fR 5 .IP \fB\-p\fR 5
Send pings to each of a target host's multiple interfaces. In looping or counting modes (\-l, \-c, or \-C), this parameter sets the
.IP \fB-n\fR 5 time in milliseconds that
Same as -d. .B fping
.IP \fB-p\fR 5 waits between successive packets to an individual target. Default is
In looping or counting modes (-l, -c, or -C), this parameter sets the 1000.
time in milliseconds that .IP \fB\-q\fR 5
.B fping Quiet. Don't show per-target results, just set final exit status.
waits between successive packets to an individual target. Default is .IP \fB\-Q\fIn\fR 5
1000. Like \-q, but show summary results every n seconds.
.IP \fB-q\fR 5 .IP \fB\-r\fIn\fR 5
Quiet. Don't show per-target results, just set final exit status. Retry limit (default 3). This is the number of times an attempt at pinging
.IP \fB-Q\fIn\fR 5 a target will be made, not including the first try.
Like -q, but show summary results every n seconds. .IP \fB\-s\fR 5
.IP \fB-r\fIn\fR 5 Print cumulative statistics upon exit.
Retry limit (default 3). This is the number of times an attempt at pinging .IP \fB\-S\fIaddr\fR 5
a target will be made, not including the first try. Set source address.
.IP \fB-s\fR 5 .IP \fB\-I\fIif\fR 5
Print cumulative statistics upon exit. Set the interface (requires SO_BINDTODEVICE support)
.IP \fB-S\fIaddr\fR 5 .IP \fB\-t\fIn\fR 5
Set source address. Initial target timeout in milliseconds (default 500). In the default
.IP \fB-I\fIif\fR 5 mode, this is the amount of time that
Set the interface (requires SO_BINDTODEVICE support) .B fping
.IP \fB-t\fIn\fR 5 waits for a response to its first request. Successive timeouts are
Initial target timeout in milliseconds (default 500). In the default multiplied by the backoff factor.
mode, this is the amount of time that .IP \fB\-T\fIn\fR 5
.B fping Ignored (for compatibility with fping 2.4).
waits for a response to its first request. Successive timeouts are .IP \fB\-u\fR 5
multiplied by the backoff factor. Show targets that are unreachable.
.IP \fB-T\fIn\fR 5 .IP \fB\-T\fIn\fR 5
Ignored (for compatibility with fping 2.4). Set the typ of service flag (TOS). \fIn\fR can be either decimal or hexadecimal (0xh) format.
.IP \fB-u\fR 5 .IP \fB\-v\fR 5
Show targets that are unreachable. Print
.IP \fB-T\fIn\fR 5 .B fping
Set the typ of service flag (TOS). \fIn\fR can be either decimal or hexadecimal (0xh) format. version information.
.IP \fB-v\fR 5
Print .SH EXAMPLES
.B fping The following perl script will check a list of hosts and send mail if
version information. 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
.SH EXAMPLES list of systems until it reads EOF, which it gets after INPUT is closed.
The following perl script will check a list of hosts and send mail if Sure the open2 usage is not needed in this example, but it's a good open2
any are unreachable. It uses the open2 function which allows a program example none the less.
to be opened for reading and writing. fping does not start pinging the .nf
list of systems until it reads EOF, which it gets after INPUT is closed.
Sure the open2 usage is not needed in this example, but it's a good open2 #!/usr/bin/perl
example none the less. require 'open2.pl';
.nf
$MAILTO = "root";
#!/usr/bin/perl
require 'open2.pl'; $pid = &open2("OUTPUT","INPUT","/usr/local/bin/fping -u");
$MAILTO = "root"; @check=("slapshot","foo","foobar");
$pid = &open2("OUTPUT","INPUT","/usr/local/bin/fping -u"); foreach(@check) { print INPUT "$_\\n"; }
close(INPUT);
@check=("slapshot","foo","foobar"); @output=<OUTPUT>;
foreach(@check) { print INPUT "$_\\n"; } if ($#output != -1) {
close(INPUT); chop($date=`date`);
@output=<OUTPUT>; open(MAIL,"|mail -s 'unreachable systems' $MAILTO");
print MAIL "\\nThe following systems are unreachable as of: $date\\n\\n";
if ($#output != -1) { print MAIL @output;
chop($date=`date`); close MAIL;
open(MAIL,"|mail -s 'unreachable systems' $MAILTO"); }
print MAIL "\\nThe following systems are unreachable as of: $date\\n\\n";
print MAIL @output; .fi
close MAIL; Another good example is when you want to perform an action only on hosts
} that are currently reachable.
.nf
.ni
Another good example is when you want to perform an action only on hosts #!/usr/bin/perl
that are currently reachable.
.nf $hosts_to_backup = `cat /etc/hosts.backup | fping -a`;
#!/usr/bin/perl foreach $host (split(/\\n/,$hosts_to_backup)) {
# do it
$hosts_to_backup = `cat /etc/hosts.backup | fping -a`; }
foreach $host (split(/\\n/,$hosts_to_backup)) { .fi
# do it
} .SH AUTHORS
.nf
.ni Roland J. Schemers III, Stanford University, concept and versions 1.x
RL "Bob" Morgan, Stanford University, versions 2.x
.SH AUTHORS David Papp, versions 2.3x and up,
.nf David Schweikert, versions 3.0 and up
Roland J. Schemers III, Stanford University, concept and versions 1.x fping website: http://www.fping.org
RL "Bob" Morgan, Stanford University, versions 2.x .fi
David Papp, versions 2.3x and up, .SH DIAGNOSTICS
David Schweikert, versions 3.0 and up Exit status is 0 if all the hosts are reachable, 1 if some hosts were
fping website: http://www.fping.org unreachable, 2 if any IP addresses were not found, 3 for invalid
.ni command line arguments, and 4 for a system call failure.
.SH DIAGNOSTICS .SH BUGS
Exit status is 0 if all the hosts are reachable, 1 if some hosts were Ha! If we knew of any we would have fixed them!
unreachable, 2 if any IP addresses were not found, 3 for invalid .SH RESTRICTIONS
command line arguments, and 4 for a system call failure. If certain options are used (i.e, a low value for \-i and \-t, and a
.SH BUGS high value for \-r) it is possible to flood the network. This program
Ha! If we knew of any we would have fixed them! must be installed as setuid root in order to open up a raw socket,
.SH RESTRICTIONS or must be run by root. In order to stop mere mortals from hosing the
If certain options are used (i.e, a low value for -i and -t, and a network (when fping is installed setuid root) , normal users can't specify
high value for -r) it is possible to flood the network. This program the following:
must be installed as setuid root in order to open up a raw socket, .nf
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 -i n where n < 10 msec
the following: -r n where n > 20
.nf -t n where n < 250 msec
-i n where n < 10 msec .fi
-r n where n > 20 .SH SEE ALSO
-t n where n < 250 msec netstat(1), ping(8), ifconfig(8c)
.ni
.SH SEE ALSO
netstat(1), ping(8), ifconfig(8c)

@ -170,7 +170,7 @@ char *icmp_type_str[19] =
"", "",
"", "",
"ICMP Time Exceeded", /* 11 */ "ICMP Time Exceeded", /* 11 */
"ICMP Paramter Problem", /* 12 */ "ICMP Parameter Problem", /* 12 */
"ICMP Timestamp Request", /* 13 */ "ICMP Timestamp Request", /* 13 */
"ICMP Timestamp Reply", /* 14 */ "ICMP Timestamp Reply", /* 14 */
"ICMP Information Request", /* 15 */ "ICMP Information Request", /* 15 */

Loading…
Cancel
Save