diff --git a/plugins/postgresql/pgbouncer_ b/plugins/postgresql/pgbouncer_ index 208d663e..610c4834 100755 --- a/plugins/postgresql/pgbouncer_ +++ b/plugins/postgresql/pgbouncer_ @@ -157,13 +157,16 @@ if (defined($ARGV[0])) } # connect to data -my $dbh = DBI->connect("DBI:Pg:dbname=$db_name;host=$db_host;port=$db_port", $db_user, $db_pass); +my $dbh = DBI->connect("DBI:Pg:dbname=$db_name;host=$db_host;port=$db_port", $db_user, $db_pass) + or die ("Cannot connect to database"); # go trough each set and get the data foreach my $get ('pools', 'stats') { # prep and execute the show query - my $pre = $dbh->prepare("SHOW $get"); - $pre->execute(); + my $pre = $dbh->prepare("SHOW $get") + or die ("Cannot prepare query"); + $pre->execute() + or die ("Cannot execute statement") while (@data = $pre->fetchrow) { # first defines the pool