From f64d44f49ac06411a136db1177edbbdd71538495 Mon Sep 17 00:00:00 2001 From: Greg Sabino Mullane Date: Mon, 4 Jul 2011 14:44:42 -0400 Subject: [PATCH] The database name is not always available (e.g. check_checkpoint) --- check_postgres.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/check_postgres.pl b/check_postgres.pl index 3be87c1ae..740f635d9 100755 --- a/check_postgres.pl +++ b/check_postgres.pl @@ -1338,7 +1338,7 @@ sub add_response { } my $dbservice = $db->{dbservice}; - my $dbname = qq{DB "$db->{dbname}"}; + my $dbname = defined $db->{dbname} ? qq{DB "$db->{dbname}"} : ''; my $dbhost = (!$db->{host} or $db->{host} eq '') ? '' : qq{ (host:$db->{host})}; my $dbport = defined $db->{port} ? ($db->{port} eq $opt{defaultport} ? '' : qq{ (port=$db->{port}) }) : ''; -- 2.30.2