[check_postgres] Patch to fix an issue with last vacuum/analyze path when one uses a service to connect

Guillaume Lelarge guillaume at lelarge.info
Mon Aug 31 09:20:08 UTC 2009


Hi,

I had this issue on a customer's server:

[somebody at somewhere ~]$ ./check_postgres.pl --dbservice someservice --action 
last_analyze
Use of uninitialized value in concatenation (.) or string at 
./check_postgres.pl line 3422.                                                                                         
Use of uninitialized value in concatenation (.) or string at 
./check_postgres.pl line 3422.                                                                                         
[ many many more messages of this kind ]
POSTGRES_LAST_ANALYZE CRITICAL: service=someservice pg_catalog.pg_statistic: 
15:22 May 25, 2009 (13 semaines 6 jours 19 heures 45 minutes) | time=0.01  
.pg_catalog.pg_statistic=8451909s;86400;172800 
.pg_catalog.pg_authid=1544082s;86400;172800 etc...

It happens only when you use --dbservice option, which we tend to use a lot. 
When someone use this option, $db->{dbname} is not initialized.

The patch attached seems to fix it. Please, take a careful look at it as I'm 
not a Perl coder. There's certainly a better way to fix this. Moreover, there 
are others $db->{dbname} that probably need to be transform to $dbname.

Regards.


-- 
Guillaume.
 http://www.postgresqlfr.org
 http://dalibo.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: lastvacuumanalyze.patch
Type: text/x-patch
Size: 780 bytes
Desc: not available
Url : https://mail.endcrypt.com/pipermail/check_postgres/attachments/20090831/9c830899/attachment.bin 


More information about the Check_postgres mailing list