From ea6dfaba0723d681b0d4aa2b607311ec12128c8d Mon Sep 17 00:00:00 2001 From: Greg Sabino Mullane Date: Mon, 24 Mar 2008 18:21:33 -0400 Subject: [PATCH] Use query_start, not xact_start for txn_idle, per Robert Treat. --- check_postgres.pl | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/check_postgres.pl b/check_postgres.pl index bde3a8131..4f2e6ce9c 100755 --- a/check_postgres.pl +++ b/check_postgres.pl @@ -23,7 +23,7 @@ $Data::Dumper::Varname = 'POSTGRES'; $Data::Dumper::Indent = 2; $Data::Dumper::Useqq = 1; -our $VERSION = '1.3.0'; +our $VERSION = '1.3.1'; use vars qw/ %opt $PSQL $res $COM $SQL $db /; @@ -359,7 +359,7 @@ my %testaction = ( relation_size => 'VERSION: 8.1', table_size => 'VERSION: 8.1', index_size => 'VERSION: 8.1', - txn_idle => 'VERSION: 8.3', + txn_idle => 'VERSION: 8.2', txn_time => 'VERSION: 8.3', ); if ($opt{test}) { @@ -2137,7 +2137,7 @@ sub check_txn_idle { type => 'time', }); - $SQL = q{SELECT datname, max(COALESCE(ROUND(EXTRACT(epoch FROM now()-xact_start)),0)) }. + $SQL = q{SELECT datname, max(COALESCE(ROUND(EXTRACT(epoch FROM now()-query_start)),0)) }. q{FROM pg_stat_activity WHERE current_query = ' in transaction' GROUP BY 1}; my $info = run_command($SQL, { regex => qr[\s*.+?\s+\|\s+\d+], emptyok => 1 } ); @@ -2375,7 +2375,7 @@ check_postgres.pl - Postgres monitoring script for Nagios =head1 VERSION -This documents describes check_postgres.pl version 1.3.0 +This documents describes check_postgres.pl version 1.3.1 =head1 SYNOPSIS @@ -2970,6 +2970,10 @@ Development happens using the git system. You can clone the latest version by do =over 4 +=item B + +Have txn_idle use query_start, not xact_start + =item B Add in txn_idle and txn_time actions. -- 2.39.5