/[mon-modules]/fping+args.monitor
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /fping+args.monitor

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by dpavlin, Wed Jul 10 08:53:22 2002 UTC revision 1.2 by dpavlin, Wed Jul 10 09:26:32 2002 UTC
# Line 56  my $END_TIME; Line 56  my $END_TIME;
56    
57  exit 0 if (@ARGV == 0);  exit 0 if (@ARGV == 0);
58    
59  open (IN, "$CMD @ARGV 2>&1 |") ||  my @hosts;
60    
61    # you can use hosts in format host:optional configuration parameters and
62    # this part will strip everything after hostname
63    foreach (@ARGV) {
64            if (m/^[^:]+:?[^\@]*\@([^\/]+)\/?.*/) {
65                    push @hosts,$1;
66            } else {
67                    push @hosts,$_;
68            }
69    }
70    
71    open (IN, "$CMD @hosts 2>&1 |") ||
72          die "could not open pipe to fping: $!\n";          die "could not open pipe to fping: $!\n";
73    
74  my @unreachable;  my @unreachable;
# Line 67  my @error;             # other errors which I'll gi Line 79  my @error;             # other errors which I'll gi
79  my @icmp;               # ICMP messages output by fping  my @icmp;               # ICMP messages output by fping
80  my %addr_unknown;  my %addr_unknown;
81    
82  my %want_host = map { $_ => 1 } @ARGV;  # hosts fping hasn't output yet  my %want_host = map { $_ => 1 } @hosts; # hosts fping hasn't output yet
83    
84  while (<IN>)  while (<IN>)
85  {  {

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

  ViewVC Help
Powered by ViewVC 1.1.26