The database name is not always available (e.g. check_checkpoint)
authorGreg Sabino Mullane <[email protected]>
Mon, 4 Jul 2011 18:44:42 +0000 (14:44 -0400)
committerGreg Sabino Mullane <[email protected]>
Mon, 4 Jul 2011 18:44:42 +0000 (14:44 -0400)
check_postgres.pl

index 3be87c1ae7e09aec995dc6bf30c74703809e4dd1..740f635d93671907deae26ea712d88e88acd293d 100755 (executable)
@@ -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}) }) : '';