--- fping+args.monitor 2002/07/10 08:53:22 1.1 +++ fping+args.monitor 2002/07/10 09:26:32 1.2 @@ -56,7 +56,19 @@ exit 0 if (@ARGV == 0); -open (IN, "$CMD @ARGV 2>&1 |") || +my @hosts; + +# you can use hosts in format host:optional configuration parameters and +# this part will strip everything after hostname +foreach (@ARGV) { + if (m/^[^:]+:?[^\@]*\@([^\/]+)\/?.*/) { + push @hosts,$1; + } else { + push @hosts,$_; + } +} + +open (IN, "$CMD @hosts 2>&1 |") || die "could not open pipe to fping: $!\n"; my @unreachable; @@ -67,7 +79,7 @@ my @icmp; # ICMP messages output by fping my %addr_unknown; -my %want_host = map { $_ => 1 } @ARGV; # hosts fping hasn't output yet +my %want_host = map { $_ => 1 } @hosts; # hosts fping hasn't output yet while () {