/[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.2 by dpavlin, Wed Jul 10 09:26:32 2002 UTC revision 1.4 by dpavlin, Fri Jul 26 10:43:47 2002 UTC
# Line 1  Line 1 
1  #!/usr/bin/perl  #!/usr/bin/perl -w
2  #  #
3  # Return a list of hosts which not reachable via ICMP echo  # Return a list of hosts which not reachable via ICMP echo
4  #  #
5  # Jim Trocki, trockij@transmeta.com  # Jim Trocki, trockij@transmeta.com
6  #  #
7    # This module is modified to recognize hosts in format
8    # username[:password]@host/database ...
9    # which is used my pgsql.monitor (of course, just host is used) by
10    # Dobrica Pavlinusic, dpavlin@rot13.org
11    # http://www.rot13.org/~dpavlin/sysadm.html
12    #
13  # $Id$  # $Id$
14  #  #
15  #    Copyright (C) 1998, Jim Trocki  #    Copyright (C) 1998, Jim Trocki
# Line 62  my @hosts; Line 68  my @hosts;
68  # this part will strip everything after hostname  # this part will strip everything after hostname
69  foreach (@ARGV) {  foreach (@ARGV) {
70          if (m/^[^:]+:?[^\@]*\@([^\/]+)\/?.*/) {          if (m/^[^:]+:?[^\@]*\@([^\/]+)\/?.*/) {
71                  push @hosts,$1;                  my $host = $1;
72                    push @hosts,$host if (! grep /^$host$/,@hosts);
73          } else {          } else {
74                  push @hosts,$_;                  push @hosts,$_ if (! grep /^$_$/,@hosts);
75          }          }
76  }  }
77    

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

  ViewVC Help
Powered by ViewVC 1.1.26