[check_postgres] Change to show query details for slow query time

Giles Westwood giles.westwood at semantico.com
Mon Mar 1 17:48:12 UTC 2010


Giles Westwood wrote:
> Greg Sabino Mullane wrote:
>>> We had a need to see the client port of slow query to trace the pid 
>>> of the process holding the connection open. I modified check_postgres 
>>> to display this:-
>>
>> Excellent, thanks. Two minor things:
>>
>> * Can you supply this as a diff? Ideally as a github branch, but any 
>> ol' diff is fine.
>>
>> * Have you tested against older versions of Postgres? I don't know 
>> offhand which columns from pg_stat_activity go back how far, but 
>> check_postgres purports to check back to version 8.
>>
> 
> Hi Greg,
> 
> We've made quite a few changes from the original version now, the patch 
> is to make all the changes, so it still might be better to just look at 
> the function. For what it's worth I tested on 8.2, and we've seen those 
> columns on 8.1.
> 
> g.
> 
Hi Greg,

Found a typo on the msg line:-

$msg .= " procpid:$procpid, client_addr:$client_addr, 
client_port:$client_port. Run sudo netstat -anp and grep $client_port?";


-- 
Giles Westwood, Systems Administrator,
Semantico, Floor 1, 21-23 Dyke Road, Brighton BN1 3FE
<http://www.semantico.com/>
<mailto:Giles.Westwood at semantico.com>
<tel:+44-1273-358231> <fax:+44-1273-723232>


More information about the Check_postgres mailing list