From bb216546917802de2eda366578f3bc2108a008da Mon Sep 17 00:00:00 2001 From: Axel Beckert Date: Wed, 25 Apr 2012 22:06:02 +0200 Subject: [PATCH 1/8] Fix typo "Paramter" --- src/fping.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fping.c b/src/fping.c index 562859e..a898249 100644 --- a/src/fping.c +++ b/src/fping.c @@ -170,7 +170,7 @@ char *icmp_type_str[19] = "", "", "ICMP Time Exceeded", /* 11 */ - "ICMP Paramter Problem", /* 12 */ + "ICMP Parameter Problem", /* 12 */ "ICMP Timestamp Request", /* 13 */ "ICMP Timestamp Reply", /* 14 */ "ICMP Information Request", /* 15 */ From c4ba6af7b30297742a06ac0f2b8ee8e1be52859e Mon Sep 17 00:00:00 2001 From: Axel Beckert Date: Wed, 25 Apr 2012 22:11:09 +0200 Subject: [PATCH 2/8] Fix lintian warnings hyphen-used-as-minus-sign in man-page --- doc/fping.8 | 74 ++++++++++++++++++++++++++--------------------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/doc/fping.8 b/doc/fping.8 index 4ed12d6..8a846c1 100644 --- a/doc/fping.8 +++ b/doc/fping.8 @@ -42,11 +42,11 @@ Unlike is meant to be used in scripts, so its output is designed to be easy to parse. .SH OPTIONS -.IP \fB-a\fR 5 +.IP \fB\-a\fR 5 Show systems that are alive. -.IP \fB-A\fR 5 +.IP \fB\-A\fR 5 Display targets by address rather than DNS name. -.IP \fB-b\fIn\fR 5 +.IP \fB\-b\fIn\fR 5 Number of bytes of ping data to send. The minimum size (normally 12) allows room for the data that .B fping @@ -57,95 +57,95 @@ header (8 bytes), so the minimum total size is 40 bytes. Default is .B ping. Maximum is the theoretical maximum IP datagram size (64K), though most systems limit this to a smaller, system-dependent number. -.IP \fB-B\fIn\fR 5 +.IP \fB\-B\fIn\fR 5 In the default mode, .B fping sends several requests to a target before giving up, waiting longer for a reply on each successive request. This parameter is the value by which the wait time is multiplied on each successive request; it must be entered as a floating-point number (x.y). The default is 1.5. -.IP \fB-c\fR 5 +.IP \fB\-c\fR 5 Number of request packets to send to each target. In this mode, a line is displayed for each received response (this can suppressed with --q or -Q). Also, statistics about responses for each target are displayed +\-q or \-Q). Also, statistics about responses for each target are displayed when all requests have been sent (or when interrupted). .IP \fB-C\fR 5 -Similar to -c, but the per-target statistics are displayed in a format +Similar to \-c, but the per-target statistics are displayed in a format designed for automated response-time statistics gathering. For example: -% fping -C 5 -q somehost +% fping \-C 5 \-q somehost -somehost : 91.7 37.0 29.2 - 36.8 +somehost : 91.7 37.0 29.2 \- 36.8 shows the response time in milliseconds for each of the five requests, -with the "-" indicating that no response was received to the fourth +with the "\-" indicating that no response was received to the fourth request. -.IP \fB-d\fR 5 +.IP \fB\-d\fR 5 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. -.IP \fB-e\fR 5 +.IP \fB\-e\fR 5 Show elapsed (round-trip) time of packets. -.IP \fB-f\fR 5 +.IP \fB\-f\fR 5 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: % fping < targets_file -.IP \fB-g\fR 5 +.IP \fB\-g\fR 5 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 192.168.1.0/24 +fping \-g 192.168.1.0/24 or fping -g 192.168.1.0 192.168.1.255 -.IP \fB-h\fR 5 +.IP \fB\-h\fR 5 Print usage message. -.IP \fB-i\fIn\fR 5 +.IP \fB\-i\fIn\fR 5 The minimum amount of time (in milliseconds) between sending a ping packet to any target (default is 25). -.IP \fB-l\fR 5 +.IP \fB\-l\fR 5 Loop sending packets to each target indefinitely. Can be interrupted with ctl-C; statistics about responses for each target are then displayed. -.IP \fB-m\fR 5 +.IP \fB\-m\fR 5 Send pings to each of a target host's multiple interfaces. -.IP \fB-n\fR 5 -Same as -d. -.IP \fB-p\fR 5 -In looping or counting modes (-l, -c, or -C), this parameter sets the +.IP \fB\-n\fR 5 +Same as \-d. +.IP \fB\-p\fR 5 +In looping or counting modes (\-l, \-c, or \-C), this parameter sets the time in milliseconds that .B fping waits between successive packets to an individual target. Default is 1000. -.IP \fB-q\fR 5 +.IP \fB\-q\fR 5 Quiet. Don't show per-target results, just set final exit status. -.IP \fB-Q\fIn\fR 5 -Like -q, but show summary results every n seconds. -.IP \fB-r\fIn\fR 5 +.IP \fB\-Q\fIn\fR 5 +Like \-q, but show summary results every n seconds. +.IP \fB\-r\fIn\fR 5 Retry limit (default 3). This is the number of times an attempt at pinging a target will be made, not including the first try. -.IP \fB-s\fR 5 +.IP \fB\-s\fR 5 Print cumulative statistics upon exit. -.IP \fB-S\fIaddr\fR 5 +.IP \fB\-S\fIaddr\fR 5 Set source address. -.IP \fB-I\fIif\fR 5 +.IP \fB\-I\fIif\fR 5 Set the interface (requires SO_BINDTODEVICE support) -.IP \fB-t\fIn\fR 5 +.IP \fB\-t\fIn\fR 5 Initial target timeout in milliseconds (default 500). In the default mode, this is the amount of time that .B fping waits for a response to its first request. Successive timeouts are multiplied by the backoff factor. -.IP \fB-T\fIn\fR 5 +.IP \fB\-T\fIn\fR 5 Ignored (for compatibility with fping 2.4). -.IP \fB-u\fR 5 +.IP \fB\-u\fR 5 Show targets that are unreachable. -.IP \fB-T\fIn\fR 5 +.IP \fB\-T\fIn\fR 5 Set the typ of service flag (TOS). \fIn\fR can be either decimal or hexadecimal (0xh) format. -.IP \fB-v\fR 5 +.IP \fB\-v\fR 5 Print .B fping version information. @@ -210,8 +210,8 @@ command line arguments, and 4 for a system call failure. .SH BUGS Ha! If we knew of any we would have fixed them! .SH RESTRICTIONS -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 +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 From d4d4106faa4b8d8e5b0d1824710aec1d08b29203 Mon Sep 17 00:00:00 2001 From: Axel Beckert Date: Wed, 25 Apr 2012 22:11:49 +0200 Subject: [PATCH 3/8] man page: ctl -> Ctrl --- doc/fping.8 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/fping.8 b/doc/fping.8 index 8a846c1..e23a3b1 100644 --- a/doc/fping.8 +++ b/doc/fping.8 @@ -109,7 +109,7 @@ Print usage message. The minimum amount of time (in milliseconds) between sending a ping packet to any target (default is 25). .IP \fB\-l\fR 5 Loop sending packets to each target indefinitely. Can be interrupted -with ctl-C; statistics about responses for each target are then displayed. +with Ctrl-C; statistics about responses for each target are then displayed. .IP \fB\-m\fR 5 Send pings to each of a target host's multiple interfaces. .IP \fB\-n\fR 5 From 6161a0552d2cc4951e14730ea2fa168f79fa657f Mon Sep 17 00:00:00 2001 From: Axel Beckert Date: Wed, 25 Apr 2012 22:15:42 +0200 Subject: [PATCH 4/8] Fix trailing whitespace in man-page --- doc/fping.8 | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/doc/fping.8 b/doc/fping.8 index e23a3b1..76ed4c5 100644 --- a/doc/fping.8 +++ b/doc/fping.8 @@ -10,36 +10,36 @@ fping \- send ICMP ECHO_REQUEST packets to network hosts .NXR "fping command" .NXR "ICMP ECHO_REQUEST" - -.B fping + +.B fping is a program like .B ping(8) which uses the Internet Control Message Protocol (ICMP) echo request to determine if a target host is -responding. -.B fping +responding. +.B fping differs from ping in that you can specify any number of targets on the command line, or specify a file containing the lists of targets to ping. Instead of sending to one target until it -times out or replies, -.B fping +times out or replies, +.B fping will send out a ping packet and move -on to the next target in a round-robin fashion. +on to the next target in a round-robin fashion. .PP In the default mode, if a target replies, it is noted and removed from the list of targets to check; if a target -does not respond within a certain time limit and/or retry limit it -is designated as unreachable. -.B fping +does not respond within a certain time limit and/or retry limit it +is designated as unreachable. +.B fping also supports sending a specified number of pings to a target, or -looping indefinitely (as in +looping indefinitely (as in .B ping ). .PP -Unlike +Unlike .B ping, -.B fping -is meant to be used in scripts, so its output is designed to be +.B fping +is meant to be used in scripts, so its output is designed to be easy to parse. .SH OPTIONS .IP \fB\-a\fR 5 @@ -48,12 +48,12 @@ Show systems that are alive. Display targets by address rather than DNS name. .IP \fB\-b\fIn\fR 5 Number of bytes of ping data to send. The minimum size (normally 12) -allows room for the data that -.B fping +allows room for the data that +.B fping needs to do its work (sequence number, timestamp). The reported received data size includes the IP header (normally 20 bytes) and ICMP header (8 bytes), so the minimum total size is 40 bytes. Default is -56, as in +56, as in .B ping. Maximum is the theoretical maximum IP datagram size (64K), though most systems limit this to a smaller, system-dependent number. @@ -135,7 +135,7 @@ Set source address. Set the interface (requires SO_BINDTODEVICE support) .IP \fB\-t\fIn\fR 5 Initial target timeout in milliseconds (default 500). In the default -mode, this is the amount of time that +mode, this is the amount of time that .B fping waits for a response to its first request. Successive timeouts are multiplied by the backoff factor. @@ -146,7 +146,7 @@ Show targets that are unreachable. .IP \fB\-T\fIn\fR 5 Set the typ of service flag (TOS). \fIn\fR can be either decimal or hexadecimal (0xh) format. .IP \fB\-v\fR 5 -Print +Print .B fping version information. @@ -154,9 +154,9 @@ version information. 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. +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 -example none the less. +example none the less. .nf #!/usr/bin/perl @@ -210,11 +210,11 @@ command line arguments, and 4 for a system call failure. .SH BUGS Ha! If we knew of any we would have fixed them! .SH RESTRICTIONS -If certain options are used (i.e, a low value for \-i and \-t, and a +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 +network (when fping is installed setuid root) , normal users can't specify the following: .nf From adf7be95fdfd59a38979f0832f8762b5556e8a86 Mon Sep 17 00:00:00 2001 From: Axel Beckert Date: Wed, 25 Apr 2012 22:17:06 +0200 Subject: [PATCH 5/8] Fix multiple blank lines in man-page --- doc/fping.8 | 2 -- 1 file changed, 2 deletions(-) diff --git a/doc/fping.8 b/doc/fping.8 index 76ed4c5..a155712 100644 --- a/doc/fping.8 +++ b/doc/fping.8 @@ -10,7 +10,6 @@ fping \- send ICMP ECHO_REQUEST packets to network hosts .NXR "fping command" .NXR "ICMP ECHO_REQUEST" - .B fping is a program like .B ping(8) @@ -225,4 +224,3 @@ the following: .ni .SH SEE ALSO netstat(1), ping(8), ifconfig(8c) - From bc284126713a00e14d27ce2e0e4e5f3eea05be13 Mon Sep 17 00:00:00 2001 From: Axel Beckert Date: Wed, 25 Apr 2012 22:17:53 +0200 Subject: [PATCH 6/8] Fix line DOS (^M) endings in man-page --- doc/fping.8 | 452 ++++++++++++++++++++++++++-------------------------- 1 file changed, 226 insertions(+), 226 deletions(-) diff --git a/doc/fping.8 b/doc/fping.8 index a155712..4790a0a 100644 --- a/doc/fping.8 +++ b/doc/fping.8 @@ -1,226 +1,226 @@ -.TH fping 8 -.SH NAME -fping \- send ICMP ECHO_REQUEST packets to network hosts -.SH SYNOPSIS -.B fping -[ \fIoptions\fR ] -[ \fIsystems...\fR ] - -.SH DESCRIPTION -.NXR "fping command" -.NXR "ICMP ECHO_REQUEST" - -.B fping -is a program like -.B ping(8) -which uses the Internet Control -Message Protocol (ICMP) echo request to determine if a target host is -responding. -.B fping -differs from ping in that you can specify any -number of targets on the command line, or specify a file containing -the lists of targets to ping. Instead of sending to one target until it -times out or replies, -.B fping -will send out a ping packet and move -on to the next target in a round-robin fashion. -.PP -In the default mode, if a target replies, -it is noted and removed from the list of targets to check; if a target -does not respond within a certain time limit and/or retry limit it -is designated as unreachable. -.B fping -also supports sending a specified number of pings to a target, or -looping indefinitely (as in -.B ping -). -.PP -Unlike -.B ping, -.B fping -is meant to be used in scripts, so its output is designed to be -easy to parse. -.SH OPTIONS -.IP \fB\-a\fR 5 -Show systems that are alive. -.IP \fB\-A\fR 5 -Display targets by address rather than DNS name. -.IP \fB\-b\fIn\fR 5 -Number of bytes of ping data to send. The minimum size (normally 12) -allows room for the data that -.B fping -needs to do its work (sequence number, timestamp). The reported -received data size includes the IP header (normally 20 bytes) and ICMP -header (8 bytes), so the minimum total size is 40 bytes. Default is -56, as in -.B ping. -Maximum is the theoretical maximum IP datagram size (64K), though most -systems limit this to a smaller, system-dependent number. -.IP \fB\-B\fIn\fR 5 -In the default mode, -.B fping -sends several requests to a target before giving up, waiting longer for -a reply on each successive request. This parameter is the value by -which the wait time is multiplied on each successive request; it must -be entered as a floating-point number (x.y). The default is 1.5. -.IP \fB\-c\fR 5 -Number of request packets to send to each target. In this mode, a -line is displayed for each received response (this can suppressed with -\-q or \-Q). Also, statistics about responses for each target are displayed -when all requests have been sent (or when interrupted). -.IP \fB-C\fR 5 -Similar to \-c, but the per-target statistics are displayed in a format -designed for automated response-time statistics gathering. For -example: - -% fping \-C 5 \-q somehost - -somehost : 91.7 37.0 29.2 \- 36.8 - -shows the response time in milliseconds for each of the five requests, -with the "\-" indicating that no response was received to the fourth -request. -.IP \fB\-d\fR 5 -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. -.IP \fB\-e\fR 5 -Show elapsed (round-trip) time of packets. -.IP \fB\-f\fR 5 -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: - -% fping < targets_file - -.IP \fB\-g\fR 5 -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 192.168.1.0/24 - -or - -fping -g 192.168.1.0 192.168.1.255 -.IP \fB\-h\fR 5 -Print usage message. -.IP \fB\-i\fIn\fR 5 -The minimum amount of time (in milliseconds) between sending a ping packet to any target (default is 25). -.IP \fB\-l\fR 5 -Loop sending packets to each target indefinitely. Can be interrupted -with Ctrl-C; statistics about responses for each target are then displayed. -.IP \fB\-m\fR 5 -Send pings to each of a target host's multiple interfaces. -.IP \fB\-n\fR 5 -Same as \-d. -.IP \fB\-p\fR 5 -In looping or counting modes (\-l, \-c, or \-C), this parameter sets the -time in milliseconds that -.B fping -waits between successive packets to an individual target. Default is -1000. -.IP \fB\-q\fR 5 -Quiet. Don't show per-target results, just set final exit status. -.IP \fB\-Q\fIn\fR 5 -Like \-q, but show summary results every n seconds. -.IP \fB\-r\fIn\fR 5 -Retry limit (default 3). This is the number of times an attempt at pinging -a target will be made, not including the first try. -.IP \fB\-s\fR 5 -Print cumulative statistics upon exit. -.IP \fB\-S\fIaddr\fR 5 -Set source address. -.IP \fB\-I\fIif\fR 5 -Set the interface (requires SO_BINDTODEVICE support) -.IP \fB\-t\fIn\fR 5 -Initial target timeout in milliseconds (default 500). In the default -mode, this is the amount of time that -.B fping -waits for a response to its first request. Successive timeouts are -multiplied by the backoff factor. -.IP \fB\-T\fIn\fR 5 -Ignored (for compatibility with fping 2.4). -.IP \fB\-u\fR 5 -Show targets that are unreachable. -.IP \fB\-T\fIn\fR 5 -Set the typ of service flag (TOS). \fIn\fR can be either decimal or hexadecimal (0xh) format. -.IP \fB\-v\fR 5 -Print -.B fping -version information. - -.SH EXAMPLES -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 needed in this example, but it's a good open2 -example none the less. -.nf - -#!/usr/bin/perl -require 'open2.pl'; - -$MAILTO = "root"; - -$pid = &open2("OUTPUT","INPUT","/usr/local/bin/fping -u"); - -@check=("slapshot","foo","foobar"); - -foreach(@check) { print INPUT "$_\\n"; } -close(INPUT); -@output=; - -if ($#output != -1) { - chop($date=`date`); - open(MAIL,"|mail -s 'unreachable systems' $MAILTO"); - print MAIL "\\nThe following systems are unreachable as of: $date\\n\\n"; - print MAIL @output; - close MAIL; -} - -.ni -Another good example is when you want to perform an action only on hosts -that are currently reachable. -.nf - -#!/usr/bin/perl - -$hosts_to_backup = `cat /etc/hosts.backup | fping -a`; - -foreach $host (split(/\\n/,$hosts_to_backup)) { - # do it -} - -.ni - -.SH AUTHORS -.nf -Roland J. Schemers III, Stanford University, concept and versions 1.x -RL "Bob" Morgan, Stanford University, versions 2.x -David Papp, versions 2.3x and up, -David Schweikert, versions 3.0 and up -fping website: http://www.fping.org -.ni -.SH DIAGNOSTICS -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. -.SH BUGS -Ha! If we knew of any we would have fixed them! -.SH RESTRICTIONS -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 following: -.nf - - -i n where n < 10 msec - -r n where n > 20 - -t n where n < 250 msec - -.ni -.SH SEE ALSO -netstat(1), ping(8), ifconfig(8c) +.TH fping 8 +.SH NAME +fping \- send ICMP ECHO_REQUEST packets to network hosts +.SH SYNOPSIS +.B fping +[ \fIoptions\fR ] +[ \fIsystems...\fR ] + +.SH DESCRIPTION +.NXR "fping command" +.NXR "ICMP ECHO_REQUEST" + +.B fping +is a program like +.B ping(8) +which uses the Internet Control +Message Protocol (ICMP) echo request to determine if a target host is +responding. +.B fping +differs from ping in that you can specify any +number of targets on the command line, or specify a file containing +the lists of targets to ping. Instead of sending to one target until it +times out or replies, +.B fping +will send out a ping packet and move +on to the next target in a round-robin fashion. +.PP +In the default mode, if a target replies, +it is noted and removed from the list of targets to check; if a target +does not respond within a certain time limit and/or retry limit it +is designated as unreachable. +.B fping +also supports sending a specified number of pings to a target, or +looping indefinitely (as in +.B ping +). +.PP +Unlike +.B ping, +.B fping +is meant to be used in scripts, so its output is designed to be +easy to parse. +.SH OPTIONS +.IP \fB\-a\fR 5 +Show systems that are alive. +.IP \fB\-A\fR 5 +Display targets by address rather than DNS name. +.IP \fB\-b\fIn\fR 5 +Number of bytes of ping data to send. The minimum size (normally 12) +allows room for the data that +.B fping +needs to do its work (sequence number, timestamp). The reported +received data size includes the IP header (normally 20 bytes) and ICMP +header (8 bytes), so the minimum total size is 40 bytes. Default is +56, as in +.B ping. +Maximum is the theoretical maximum IP datagram size (64K), though most +systems limit this to a smaller, system-dependent number. +.IP \fB\-B\fIn\fR 5 +In the default mode, +.B fping +sends several requests to a target before giving up, waiting longer for +a reply on each successive request. This parameter is the value by +which the wait time is multiplied on each successive request; it must +be entered as a floating-point number (x.y). The default is 1.5. +.IP \fB\-c\fR 5 +Number of request packets to send to each target. In this mode, a +line is displayed for each received response (this can suppressed with +\-q or \-Q). Also, statistics about responses for each target are displayed +when all requests have been sent (or when interrupted). +.IP \fB-C\fR 5 +Similar to \-c, but the per-target statistics are displayed in a format +designed for automated response-time statistics gathering. For +example: + +% fping \-C 5 \-q somehost + +somehost : 91.7 37.0 29.2 \- 36.8 + +shows the response time in milliseconds for each of the five requests, +with the "\-" indicating that no response was received to the fourth +request. +.IP \fB\-d\fR 5 +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. +.IP \fB\-e\fR 5 +Show elapsed (round-trip) time of packets. +.IP \fB\-f\fR 5 +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: + +% fping < targets_file + +.IP \fB\-g\fR 5 +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 192.168.1.0/24 + +or + +fping -g 192.168.1.0 192.168.1.255 +.IP \fB\-h\fR 5 +Print usage message. +.IP \fB\-i\fIn\fR 5 +The minimum amount of time (in milliseconds) between sending a ping packet to any target (default is 25). +.IP \fB\-l\fR 5 +Loop sending packets to each target indefinitely. Can be interrupted +with Ctrl-C; statistics about responses for each target are then displayed. +.IP \fB\-m\fR 5 +Send pings to each of a target host's multiple interfaces. +.IP \fB\-n\fR 5 +Same as \-d. +.IP \fB\-p\fR 5 +In looping or counting modes (\-l, \-c, or \-C), this parameter sets the +time in milliseconds that +.B fping +waits between successive packets to an individual target. Default is +1000. +.IP \fB\-q\fR 5 +Quiet. Don't show per-target results, just set final exit status. +.IP \fB\-Q\fIn\fR 5 +Like \-q, but show summary results every n seconds. +.IP \fB\-r\fIn\fR 5 +Retry limit (default 3). This is the number of times an attempt at pinging +a target will be made, not including the first try. +.IP \fB\-s\fR 5 +Print cumulative statistics upon exit. +.IP \fB\-S\fIaddr\fR 5 +Set source address. +.IP \fB\-I\fIif\fR 5 +Set the interface (requires SO_BINDTODEVICE support) +.IP \fB\-t\fIn\fR 5 +Initial target timeout in milliseconds (default 500). In the default +mode, this is the amount of time that +.B fping +waits for a response to its first request. Successive timeouts are +multiplied by the backoff factor. +.IP \fB\-T\fIn\fR 5 +Ignored (for compatibility with fping 2.4). +.IP \fB\-u\fR 5 +Show targets that are unreachable. +.IP \fB\-T\fIn\fR 5 +Set the typ of service flag (TOS). \fIn\fR can be either decimal or hexadecimal (0xh) format. +.IP \fB\-v\fR 5 +Print +.B fping +version information. + +.SH EXAMPLES +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 needed in this example, but it's a good open2 +example none the less. +.nf + +#!/usr/bin/perl +require 'open2.pl'; + +$MAILTO = "root"; + +$pid = &open2("OUTPUT","INPUT","/usr/local/bin/fping -u"); + +@check=("slapshot","foo","foobar"); + +foreach(@check) { print INPUT "$_\\n"; } +close(INPUT); +@output=; + +if ($#output != -1) { + chop($date=`date`); + open(MAIL,"|mail -s 'unreachable systems' $MAILTO"); + print MAIL "\\nThe following systems are unreachable as of: $date\\n\\n"; + print MAIL @output; + close MAIL; +} + +.ni +Another good example is when you want to perform an action only on hosts +that are currently reachable. +.nf + +#!/usr/bin/perl + +$hosts_to_backup = `cat /etc/hosts.backup | fping -a`; + +foreach $host (split(/\\n/,$hosts_to_backup)) { + # do it +} + +.ni + +.SH AUTHORS +.nf +Roland J. Schemers III, Stanford University, concept and versions 1.x +RL "Bob" Morgan, Stanford University, versions 2.x +David Papp, versions 2.3x and up, +David Schweikert, versions 3.0 and up +fping website: http://www.fping.org +.ni +.SH DIAGNOSTICS +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. +.SH BUGS +Ha! If we knew of any we would have fixed them! +.SH RESTRICTIONS +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 following: +.nf + + -i n where n < 10 msec + -r n where n > 20 + -t n where n < 250 msec + +.ni +.SH SEE ALSO +netstat(1), ping(8), ifconfig(8c) From 6f919ed54b903964125e15007c6c665d715975d3 Mon Sep 17 00:00:00 2001 From: Axel Beckert Date: Wed, 25 Apr 2012 22:27:13 +0200 Subject: [PATCH 7/8] Replace unknown .ni by .fi --- doc/fping.8 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/fping.8 b/doc/fping.8 index 4790a0a..c06a8dc 100644 --- a/doc/fping.8 +++ b/doc/fping.8 @@ -179,7 +179,7 @@ if ($#output != -1) { close MAIL; } -.ni +.fi Another good example is when you want to perform an action only on hosts that are currently reachable. .nf @@ -192,7 +192,7 @@ foreach $host (split(/\\n/,$hosts_to_backup)) { # do it } -.ni +.fi .SH AUTHORS .nf @@ -201,7 +201,7 @@ RL "Bob" Morgan, Stanford University, versions 2.x David Papp, versions 2.3x and up, David Schweikert, versions 3.0 and up fping website: http://www.fping.org -.ni +.fi .SH DIAGNOSTICS 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 @@ -221,6 +221,6 @@ the following: -r n where n > 20 -t n where n < 250 msec -.ni +.fi .SH SEE ALSO netstat(1), ping(8), ifconfig(8c) From d4336460251daab71ef67be28e5e5571f432302c Mon Sep 17 00:00:00 2001 From: Axel Beckert Date: Wed, 25 Apr 2012 22:27:38 +0200 Subject: [PATCH 8/8] Remove unknown .NXR macros --- doc/fping.8 | 3 --- 1 file changed, 3 deletions(-) diff --git a/doc/fping.8 b/doc/fping.8 index c06a8dc..09a0fb1 100644 --- a/doc/fping.8 +++ b/doc/fping.8 @@ -7,9 +7,6 @@ fping \- send ICMP ECHO_REQUEST packets to network hosts [ \fIsystems...\fR ] .SH DESCRIPTION -.NXR "fping command" -.NXR "ICMP ECHO_REQUEST" - .B fping is a program like .B ping(8)