/[mon-modules]/pgsql.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 /pgsql.monitor

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

revision 1.2 by dpavlin, Wed Jul 10 08:50:00 2002 UTC revision 1.3 by dpavlin, Wed Jul 10 09:26:32 2002 UTC
# Line 70  EOP1 Line 70  EOP1
70      die();      die();
71  }  }
72    
73    my @test_db;
74    
75    foreach (@ARGV) {
76            if (m/^([^:]+):([^\@]+)\@(.+)/) {
77                    push
78                    %test[host] = $1;
79                    %test[user] = $2;
80                    %test
81                    my ($host,$user,$database) = ($1,$2,$3);
82            } else {
83                    push @failures, "Can't parse configuration: host '$_' not in host:user\@database format!";
84            }
85    }
86    
87  my( $dbh ) = DBI->connect( "DBI:$mode:dbname=$options{database};$options{host};$options{port}", $options{username}, $options{password} );  my( $dbh ) = DBI->connect( "DBI:$mode:dbname=$options{database};$options{host};$options{port}", $options{username}, $options{password} );
88  if( ! $dbh ) {  if( ! $dbh ) {
89    push( @failures, "Could not connect to $mode server $host: " . $DBI::errstr );    push( @failures, "Could not connect to $mode server $host: " . $DBI::errstr );
90    } else {
91            my $sth = $dbh -> prepare("select count(*) from pg_tables");
92  }  }
93    
94    
95    
96  if (@failures) {  if (@failures) {
97      print join (", ", @failures), "\n";      print join (", ", @failures), "\n";
98      exit 1;      exit 1;

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

  ViewVC Help
Powered by ViewVC 1.1.26