Exclude idle in transaction from the query_time per bug #43.
authorGreg Sabino Mullane <greg@endpoint.com>
Wed, 9 Feb 2011 14:36:33 +0000 (09:36 -0500)
committerGreg Sabino Mullane <greg@endpoint.com>
Wed, 9 Feb 2011 14:36:33 +0000 (09:36 -0500)
Since we've just overhauled this check, seems like a good a time
as any to make this change.

check_postgres.pl

index 96314628bab8fc3622b3d6544bd69331c3be4eb1..7b5bb11dcfcc6d246046ae4d211ed0a53ad97442 100755 (executable)
@@ -4922,7 +4922,7 @@ sub check_query_time {
                    msg('queries'),
                    msg('query-time'),
                    'query_start',
-                   q{query_start IS NOT NULL});
+                   q{query_start IS NOT NULL AND current_query <> '<IDLE> in transaction'});
 
     return;
 
@@ -8441,9 +8441,9 @@ line lists the database.
 
 =head2 B<query_time>
 
-(C<symlink: check_postgres_query_time>) Checks the length of running queries on one or more databases. There is 
-no need to run this more than once on the same database cluster.
-Databases can be filtered 
+(C<symlink: check_postgres_query_time>) Checks the length of running queries on one or more databases. 
+There is no need to run this more than once on the same database cluster. Note that 
+this already excludes queries that are "idle in transaction". Databases can be filtered 
 by using the I<--include> and I<--exclude> options. See the L</"BASIC FILTERING">
 section for more details. You can also filter on the user running the 
 query with the I<--includeuser> and I<--excludeuser> options.
@@ -9018,6 +9018,8 @@ Items not specifically attributed are by Greg Sabino Mullane.
 
   Standardize and clean up all perfdata ouput (bug #52)
 
+  Exclude "idle in transaction" from the query_time check (bug #43)
+
   Clean up the custom_query action a bit.
 
 =item B<Version 2.16.0> January 20, 2011