-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpostgresql.conf
25 lines (24 loc) · 3.06 KB
/
postgresql.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
UserParameter=postgresql.bgwriter.checkpts.shed,psql -U postgres -tA -c "select checkpoints_timed from pg_stat_bgwriter"
UserParameter=postgresql.bgwriter.checkpts.reqd,psql -U postgres -tA -c "select checkpoints_req from pg_stat_bgwriter"
UserParameter=postgresql.bgwriter.buffers.checkpt,psql -U postgres -tA -c "select buffers_checkpoint from pg_stat_bgwriter"
UserParameter=postgresql.bgwriter.buffers.clean,psql -U postgres -tA -c "select buffers_clean from pg_stat_bgwriter"
UserParameter=postgresql.bgwriter.maxwritten.clean,psql -U postgres -tA -c "select maxwritten_clean from pg_stat_bgwriter"
UserParameter=postgresql.bgwriter.buffers.backend,psql -U postgres -tA -c "select buffers_backend from pg_stat_bgwriter"
UserParameter=postgresql.bgwriter.buffers.backend.fsync,psql -U postgres -tA -c "select buffers_backend_fsync from pg_stat_bgwriter"
UserParameter=postgresql.bgwriter.buffers.alloc,psql -U postgres -tA -c "select buffers_alloc from pg_stat_bgwriter"
UserParameter=postgresql.db.discovery,psql -U postgres -tA -c "select datname from pg_database where datname not in('postgres','template0','template1')"| awk 'BEGIN {OFS=ORS=""; print "{\"data\":["} NR==1{print "{\"{#DBNAME}\":\"",$1,"\"}"} NR!=1{print ",{\"{#DBNAME}\":\"",$1,"\"}"} END {print "]}"}'
UserParameter=postgresql.db.backends[*],psql -U postgres -tA -c "select numbackends from pg_stat_database where datname='$1'"
UserParameter=postgresql.db.tup.returned[*],psql -U postgres -tA -c "select tup_returned from pg_stat_database where datname='$1'"
UserParameter=postgresql.db.tup.fetched[*],psql -U postgres -tA -c "select tup_fetched from pg_stat_database where datname='$1'"
UserParameter=postgresql.db.tup.inserted[*],psql -U postgres -tA -c "select tup_inserted from pg_stat_database where datname='$1'"
UserParameter=postgresql.db.tup.updated[*],psql -U postgres -tA -c "select tup_updated from pg_stat_database where datname='$1'"
UserParameter=postgresql.db.tup.deleted[*],psql -U postgres -tA -c "select tup_deleted from pg_stat_database where datname='$1'"
UserParameter=postgresql.db.xact.commit[*],psql -U postgres -tA -c "select xact_commit from pg_stat_database where datname='$1'"
UserParameter=postgresql.db.xact.rollback[*],psql -U postgres -tA -c "select xact_rollback from pg_stat_database where datname='$1'"
UserParameter=postgresql.db.blocks.read[*],psql -U postgres -tA -c "select blks_read from pg_stat_database where datname='$1'"
UserParameter=postgresql.db.blocks.hit[*],psql -U postgres -tA -c "select blks_hit from pg_stat_database where datname='$1'"
UserParameter=postgresql.db.size[*],psql -U postgres -tA -c "select pg_database_size('$1')"
UserParameter=postgresql.db.scans.idx[*],psql -U postgres -tA -c "select sum(idx_scan) from pg_stat_user_tables;" $1
UserParameter=postgresql.db.scans.seq[*],psql -U postgres -tA -c "select sum(seq_scan) from pg_stat_user_tables;" $1
UserParameter=postgresql.db.tup.live[*],psql -U postgres -tA -c "select sum(n_live_tup) from pg_stat_user_tables;" $1
UserParameter=postgresql.db.tup.dead[*],psql -U postgres -tA -c "select sum(n_dead_tup) from pg_stat_user_tables;" $1