From 36675f2ab3748c7f261545ae72255b1864c5d9d2 Mon Sep 17 00:00:00 2001 From: Mike Blackwell Date: Fri, 7 Oct 2011 13:09:54 -0500 Subject: Fix uninitialized string warnings when host or port not specified (eg using dbservice) --- check_postgres.pl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'check_postgres.pl') diff --git a/check_postgres.pl b/check_postgres.pl index cf9557fe1..d966daf5d 100755 --- a/check_postgres.pl +++ b/check_postgres.pl @@ -1385,21 +1385,21 @@ sub add_response { ## Databases $number = 1; - my %dlist = map { $_->{dbname}, $number++; } @targetdb; + my %dlist = map { ($_->{dbname} || ''), $number++; } @targetdb; if (keys %dlist > 1 and ! $historical) { my $dblist = join ',' => sort { $dlist{$a} <=> $dlist{$b} } keys %dlist; $dbname = qq{ (databases:$dblist)}; } ## Hosts $number = 1; - my %hostlist = map { $_->{host}, $number++; } @targetdb; + my %hostlist = map { ($_->{host} || ''), $number++; } @targetdb; if (keys %hostlist > 1 and ! $historical) { my $dblist = join ',' => sort { $hostlist{$a} <=> $hostlist{$b} } keys %hostlist; $dbhost = qq{ (hosts:$dblist)}; } ## Ports $number = 1; - my %portlist = map { $_->{port}, $number++; } @targetdb; + my %portlist = map { i($_->{port} || ''), $number++; } @targetdb; if (keys %portlist > 1 and ! $historical) { my $dblist = join ',' => sort { $portlist{$a} <=> $portlist{$b} } keys %portlist; $dbport = qq{ (ports:$dblist)}; -- cgit v1.2.3