summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xcheck_postgres.pl2
1 files changed, 1 insertions, 1 deletions
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 '<none>') ? '' : qq{ (host:$db->{host})};
my $dbport = defined $db->{port} ? ($db->{port} eq $opt{defaultport} ? '' : qq{ (port=$db->{port}) }) : '';