From a04150340f2dcdd13ba8b848431ae605d253712e Mon Sep 17 00:00:00 2001 From: Samuel Smith Date: Wed, 24 Sep 2014 16:05:40 -0500 Subject: [PATCH] postgres_queries3_: ignore internal pg_* tables, missing stuff in config --- plugins/postgresql/postgres_queries3_ | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/plugins/postgresql/postgres_queries3_ b/plugins/postgresql/postgres_queries3_ index 7909383a..cdefb2f3 100755 --- a/plugins/postgresql/postgres_queries3_ +++ b/plugins/postgresql/postgres_queries3_ @@ -28,7 +28,9 @@ # # Log info: # 20140701 - Initial -# +# 20140924 - +# -ignore internal pg tables +# -missing stuff in config use strict; @@ -46,7 +48,7 @@ select 'inserts.value ' || SUM(n_tup_ins) || E'\n' || 'updates.value ' || SUM(n_tup_upd) || E'\n' || 'deletes.value ' || SUM(n_tup_del) - from pg_stat_all_tables; + from pg_stat_all_tables where relname not like 'pg_%'; EOF @@ -56,7 +58,7 @@ my @dbs = split(/-/,$1); if( defined $ARGV[0] and $ARGV[0] eq "config" ){ print qq/graph_title Postgres All Queries -graph_args --base 1000 +graph_args --base 1000 -l 0 -r graph_vlabel Queries per \${graph_period} graph_category PostgreSQL graph_info Shows number of select, insert, update and delete queries @@ -64,31 +66,37 @@ sel_seq.label s_selects sel_seq.info Sequential selects on all tables sel_seq.type DERIVE sel_seq.min 0 +sel_seq.max 100 sel_seq_rows.label s_select rows sel_seq_rows.info Rows returned from sequential selects sel_seq_rows.type DERIVE -sel_seq.min 0 +sel_seq_rows.min 0 +sel_seq_rows.max 100 sel_idx.label i_selects sel_idx.info Sequential selects on all indexes sel_idx.type DERIVE -sel_seq.min 0 +sel_idx.min 0 +sel_idx.max 100 sel_idx_rows.label i_select rows sel_idx_rows.info Rows returned form index selects sel_idx_rows.type DERIVE -sel_seq_rows.min 0 +sel_idx_rows.min 0 +sel_idx_rows.min 100 inserts.label inserts inserts.info Rows inserted on all tables inserts.type DERIVE inserts.min 0 -inserts.critical 0.4:1 +inserts.max 100 updates.label updates updates.info Rows updated on all tables updates.type DERIVE updates.min 0 +updates.max 100 deletes.label deletes deletes.info Rows deleted from all tables deletes.type DERIVE deletes.min 0 +deletes.max 100 /; exit; }