--- fping+args.monitor 2002/07/10 09:26:32 1.2 +++ fping+args.monitor 2002/07/26 10:43:47 1.4 @@ -1,9 +1,15 @@ -#!/usr/bin/perl +#!/usr/bin/perl -w # # Return a list of hosts which not reachable via ICMP echo # # Jim Trocki, trockij@transmeta.com # +# This module is modified to recognize hosts in format +# username[:password]@host/database ... +# which is used my pgsql.monitor (of course, just host is used) by +# Dobrica Pavlinusic, dpavlin@rot13.org +# http://www.rot13.org/~dpavlin/sysadm.html +# # $Id: fping.monitor 1.7 Mon, 27 Aug 2001 14:22:45 -0400 trockij $ # # Copyright (C) 1998, Jim Trocki @@ -62,9 +68,10 @@ # this part will strip everything after hostname foreach (@ARGV) { if (m/^[^:]+:?[^\@]*\@([^\/]+)\/?.*/) { - push @hosts,$1; + my $host = $1; + push @hosts,$host if (! grep /^$host$/,@hosts); } else { - push @hosts,$_; + push @hosts,$_ if (! grep /^$_$/,@hosts); } }