segunda-feira, 14 de março de 2011

FPING - Ping de vários Hosts - Debug

FPING - Debug several Hosts

Ping outros computadores de sua rede com esta
ferramenta multi-funcional. O software envia pequenos
pacotes de informação a um computador especificado,
recebendo um pacote de retorno. Após a resposta
chegar, ele fará um relatórito, para você verificar várias
coisas como a velocidade, endereço de IP e muito mais.

O fping torna-se uma ferramenta muito útil de debug para
qualquer administrador
a partir do momento que permite o
ping de vários hosts em simlutâneo não sendo
necessário
uma quantidade enorme de janelas de "command line"
abertas.


Parametrização da chamada do comando:

---------------------------------------------------------------------------------------------------
NAME
fping - send ICMP ECHO_REQUEST packets to network hosts

SYNOPSIS
fping [ options ] [ systems... ]

DESCRIPTION

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.

OPTIONS

-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 < mailto = "root" pid =" &open2(" check="(" 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;
}

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

#!/usr/local/bin/perl

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

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

AUTHOR
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

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.

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

2

fping(l)

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 follow-
ing:

-i n where n <> 20
-t n where n <>
---------------------------------------------------------------------------------------------------

O ping de uma gama de IP's pode ser feito por exemplo através dos dois comandos abaixo:

>> abrir linha de comandos
>> colocar "fping -g 192.168.1.0/24" ou "fping -g 192.168.1.0 192.168.1.255"
>> enter

Neste caso especifico irá ser feito um ping a todos os IP's enter 192.168.1.0 e 192.168.1.255 em simultâneo.

Página de Informação e Download do FPING -
http://downsources.blogspot.com/2011/03/fping-ping-de-varios-hosts-em.html

Sem comentários:

Enviar um comentário