postgresql10监控-使用EXTENSIONS模式

postgres配置

需要安装postgresql10-contrib

在/var/lib/pgsql/10/data/postgresql.conf最后添加

shared_preload_libraries = 'pg_stat_statements'
pg_stat_statements.max = 10000
pg_stat_statements.track = all

在/var/lib/pgsql/10/data/pg_hba.conf添加

host    all             postgres        127.0.0.1/32            trust
host    all             postgres        ::1/128                 trust

创建extension

psql
    CREATE EXTENSION pg_buffercache;
    \c zabbix
    create extension pg_buffercache;

    create extension pg_stat_statements;
    \c zabbix
    create extension pg_stat_statements;

zabbix客户端配置

# EXTERNAL EXTENSIONS #
UserParameter=pgsql.buffercache.clear[*],psql -qAtX $1 -c "select count(*) from pg_buffercache where not isdirty"
UserParameter=pgsql.buffercache.dirty[*],psql -qAtX $1 -c "select count(*) from pg_buffercache where isdirty"
UserParameter=pgsql.buffercache.used[*],psql -qAtX $1 -c "select count(*) from pg_buffercache where reldatabase is not null"
UserParameter=pgsql.buffercache.total[*],psql -qAtX $1 -c "select count(*) from pg_buffercache"

# SIMPLE DISCOVERY #
UserParameter=pgsql.db.discovery[*],/bin/echo -n '{"data":['; for db in $(psql -qAtX $1 -c "select datname from pg_database where not datistemplate and datallowconn and datname!='postgres'"); do /bin/echo -n "{\"{#DBNAME}\": \"$db\"},"; done |sed -e 's:,$::'; /bin/echo -n ']}'
UserParameter=pgsql.table.discovery[*],/bin/echo -n '{"data":['; for table in $(psql -qAtX -F. $1 -c "select n.nspname,c.relname from pg_catalog.pg_class c left join pg_catalog.pg_namespace n on n.oid = c.relnamespace where c.relkind in ('r','s','') and n.nspname not in ('^pg_toast','information_schema','pg_catalog')"); do /bin/echo -n "{\"{#TABLENAME}\": \"$table\"},"; done |sed -e 's:\},$:\}:'; /bin/echo -n ']}'
UserParameter=pgsql.streaming.discovery[*],/bin/echo -n '{"data":['; for replica in $(psql -qAtX $1 -c "select client_addr from pg_stat_replication"); do /bin/echo -n "{\"{#HOTSTANDBY}\": \"$replica\"},"; done |sed -e 's:,$::'; /bin/echo -n ']}'

# GENERAL INFORMATION #
UserParameter=pgsql.ping[*],/bin/echo -e "\\\timing \n select 1" | psql -qAtX $1 | tail -1 | sed 's/:/ /g;s/:/ /g' | cut -d' ' -f2
UserParameter=pgsql.uptime[*],psql -qAtX $1 -c "select date_part('epoch', now() - pg_postmaster_start_time())::int"
UserParameter=pgsql.cache.hit[*],psql -qAtX $1 -c "select round(sum(blks_hit)*100/sum(blks_hit+blks_read), 2) from pg_stat_database"
UserParameter=pgsql.version[*],psql -qAtX $1 -c "SELECT version() AS pg_version"

# OTHER INFORMATION #
UserParameter=pgsql.table.tuples[*],psql -qAtX $1 -c "select count(*) from $2"
UserParameter=pgsql.setting[*],psql -qAtX $1 -c "select current_setting('$2')"
UserParameter=pgsql.trigger[*],psql -qAtX $1 -c "select count(*) from pg_trigger where tgenabled='O' and tgname='$2'"
UserParameter=pgsql.wal.write[*],psql -qAtX $1 -c "select pg_xlog_location_diff(pg_current_xlog_location(),'0/00000000')"
UserParameter=pgsql.wal.count[*],psql -qAtX $1 -c "select count(*) from pg_ls_dir('pg_wal')"

# BACKGROUND WRITER STATS #
UserParameter=pgsql.bgwriter.checkpoints_timed[*],psql -qAtX $1 -c "select checkpoints_timed from pg_stat_bgwriter"
UserParameter=pgsql.bgwriter.checkpoints_req[*],psql -qAtX $1 -c "select checkpoints_req from pg_stat_bgwriter"
UserParameter=pgsql.bgwriter.checkpoint_write_time[*],psql -qAtX $1 -c "select checkpoint_write_time from pg_stat_bgwriter"
UserParameter=pgsql.bgwriter.checkpoint_sync_time[*],psql -qAtX $1 -c "select checkpoint_sync_time from pg_stat_bgwriter"
UserParameter=pgsql.bgwriter.buffers_checkpoint[*],psql -qAtX $1 -c "select buffers_checkpoint from pg_stat_bgwriter"
UserParameter=pgsql.bgwriter.buffers_clean[*],psql -qAtX $1 -c "select buffers_clean from pg_stat_bgwriter"
UserParameter=pgsql.bgwriter.maxwritten_clean[*],psql -qAtX $1 -c "select maxwritten_clean from pg_stat_bgwriter"
UserParameter=pgsql.bgwriter.buffers_backend[*],psql -qAtX $1 -c "select buffers_backend from pg_stat_bgwriter"
UserParameter=pgsql.bgwriter.buffers_backend_fsync[*],psql -qAtX $1 -c "select buffers_backend_fsync from pg_stat_bgwriter"
UserParameter=pgsql.bgwriter.buffers_alloc[*],psql -qAtX $1 -c "select buffers_alloc from pg_stat_bgwriter"

# CONNECTIONS #
UserParameter=pgsql.connections.active[*],psql -qAtX $1 -c "select count(*) from pg_stat_activity where state = 'active'"
UserParameter=pgsql.connections.idle[*],psql -qAtX $1 -c "select count(*) from pg_stat_activity where state = 'idle'"
UserParameter=pgsql.connections.idle_in_transaction[*],psql -qAtX $1 -c "select count(*) from pg_stat_activity where state = 'idle in transaction'"
UserParameter=pgsql.connections.total[*],psql -qAtX $1 -c "select count(*) from pg_stat_activity"
UserParameter=pgsql.connections.total_pct[*],psql -qAtX $1 -c "select count(*)*100/(select current_setting('max_connections')::int) from pg_stat_activity"
UserParameter=pgsql.connections.waiting[*],psql -qAtX $1 -c "select count (*) from pg_stat_activity where wait_event IS NOT NULL"
UserParameter=pgsql.connections.prepared[*],psql -qAtX $1 -c "select count(*) from pg_prepared_xacts"

# TRANSACTIONS #
UserParameter=pgsql.transactions.idle[*],psql -qAtX $1 -c "select coalesce(extract(epoch from max(age(now(), query_start))), 0) from pg_stat_activity where state='idle in transaction'"
UserParameter=pgsql.transactions.active[*],psql -qAtX $1 -c "select coalesce(extract(epoch from max(age(now(), query_start))), 0) from pg_stat_activity where state <> 'idle in transaction' and state <> 'idle'"
UserParameter=pgsql.transactions.waiting[*],psql -qAtX $1 -c "select coalesce(extract(epoch from max(age(now(), query_start))), 0) from pg_stat_activity where wait_event IS NOT NULL"
UserParameter=pgsql.transactions.prepared[*],psql -qAtX $1 -c "select coalesce(extract(epoch from max(age(now(), prepared))), 0) from pg_prepared_xacts"
UserParameter=pgsql.pgstatstatements.avg_query_time[*],psql -qAtX $1 -c "select round((sum(total_time) / sum(calls))::numeric,2) from pg_stat_statements"

# SUMMARY DATABASE STATS #
UserParameter=pgsql.dbstat.sum.numbackends[*],psql -qAtX $1 -c "select sum(numbackends) from pg_stat_database"
UserParameter=pgsql.dbstat.sum.xact_commit[*],psql -qAtX $1 -c "select sum(xact_commit) from pg_stat_database"
UserParameter=pgsql.dbstat.sum.xact_rollback[*],psql -qAtX $1 -c "select sum(xact_rollback) from pg_stat_database"
UserParameter=pgsql.dbstat.sum.blks_read[*],psql -qAtX $1 -c "select sum(blks_read) from pg_stat_database"
UserParameter=pgsql.dbstat.sum.blks_hit[*],psql -qAtX $1 -c "select sum(blks_hit) from pg_stat_database"
UserParameter=pgsql.dbstat.sum.tup_returned[*],psql -qAtX $1 -c "select sum(tup_returned) from pg_stat_database"
UserParameter=pgsql.dbstat.sum.tup_fetched[*],psql -qAtX $1 -c "select sum(tup_fetched) from pg_stat_database"
UserParameter=pgsql.dbstat.sum.tup_inserted[*],psql -qAtX $1 -c "select sum(tup_inserted) from pg_stat_database"
UserParameter=pgsql.dbstat.sum.tup_updated[*],psql -qAtX $1 -c "select sum(tup_updated) from pg_stat_database"
UserParameter=pgsql.dbstat.sum.tup_deleted[*],psql -qAtX $1 -c "select sum(tup_deleted) from pg_stat_database"
UserParameter=pgsql.dbstat.sum.conflicts[*],psql -qAtX $1 -c "select sum(conflicts) from pg_stat_database"
UserParameter=pgsql.dbstat.sum.temp_files[*],psql -qAtX $1 -c "select sum(temp_files) from pg_stat_database"
UserParameter=pgsql.dbstat.sum.temp_bytes[*],psql -qAtX $1 -c "select sum(temp_bytes) from pg_stat_database"
UserParameter=pgsql.dbstat.sum.deadlocks[*],psql -qAtX $1 -c "select sum(deadlocks) from pg_stat_database"

# SPECIFIED DATABASE STATS - TODO: CREATE LLD #
UserParameter=pgsql.dbstat.numbackends[*],psql -qAtX $1 -c "select numbackends from pg_stat_database where datname = '$2'"
UserParameter=pgsql.dbstat.xact_commit[*],psql -qAtX $1 -c "select xact_commit from pg_stat_database where datname = '$2'"
UserParameter=pgsql.dbstat.xact_rollback[*],psql -qAtX $1 -c "select xact_rollback from pg_stat_database where datname = '$2'"
UserParameter=pgsql.dbstat.blks_read[*],psql -qAtX $1 -c "select blks_read from pg_stat_database where datname = '$2'"
UserParameter=pgsql.dbstat.blks_hit[*],psql -qAtX $1 -c "select blks_hit from pg_stat_database where datname = '$2'"
UserParameter=pgsql.dbstat.tup_returned[*],psql -qAtX $1 -c "select tup_returned from pg_stat_database where datname = '$2'"
UserParameter=pgsql.dbstat.tup_fetched[*],psql -qAtX $1 -c "select tup_fetched from pg_stat_database where datname = '$2'"
UserParameter=pgsql.dbstat.tup_inserted[*],psql -qAtX $1 -c "select tup_inserted from pg_stat_database where datname = '$2'"
UserParameter=pgsql.dbstat.tup_updated[*],psql -qAtX $1 -c "select tup_updated from pg_stat_database where datname = '$2'"
UserParameter=pgsql.dbstat.tup_deleted[*],psql -qAtX $1 -c "select tup_deleted from pg_stat_database where datname = '$2'"
UserParameter=pgsql.dbstat.conflicts[*],psql -qAtX $1 -c "select conflicts from pg_stat_database where datname = '$2'"
UserParameter=pgsql.dbstat.temp_files[*],psql -qAtX $1 -c "select temp_files from pg_stat_database where datname = '$2'"
UserParameter=pgsql.dbstat.temp_bytes[*],psql -qAtX $1 -c "select temp_bytes from pg_stat_database where datname = '$2'"
UserParameter=pgsql.dbstat.deadlocks[*],psql -qAtX $1 -c "select deadlocks from pg_stat_database where datname = '$2'"

# DATABASE/TABLE/INDEXES SIZE - TODO: CREATE LLD #
UserParameter=pgsql.db.size[*],psql -qAtX $1 -c "select pg_database_size('$2')"
UserParameter=pgsql.table.size[*],psql -qAtX $1 -c "select pg_relation_size('$2')"
UserParameter=pgsql.index.size[*],psql -qAtX $1 -c "select pg_total_relation_size('$2') - pg_relation_size('$2')"

# TABLE STATS #
UserParameter=pgsql.table.stat.heap_blks_read[*],psql -qAtX $1 -c "select coalesce(heap_blks_read,0) from pg_statio_user_tables where (schemaname || '.' || relname) = '$2'"
UserParameter=pgsql.table.stat.heap_blks_hit[*],psql -qAtX $1 -c "select coalesce(heap_blks_hit,0) from pg_statio_user_tables where (schemaname || '.' || relname) = '$2'"
UserParameter=pgsql.table.stat.idx_blks_read[*],psql -qAtX $1 -c "select coalesce(idx_blks_read,0) from pg_statio_user_tables where (schemaname || '.' || relname) = '$2'"
UserParameter=pgsql.table.stat.idx_blks_hit[*],psql -qAtX $1 -c "select coalesce(idx_blks_hit,0) from pg_statio_user_tables where (schemaname || '.' || relname) = '$2'"
UserParameter=pgsql.table.stat.toast_blks_read[*],psql -qAtX $1 -c "select coalesce(toast_blks_read,0) from pg_statio_user_tables where (schemaname || '.' || relname) = '$2'"
UserParameter=pgsql.table.stat.toast_blks_hit[*],psql -qAtX $1 -c "select coalesce(toast_blks_hit,0) from pg_statio_user_tables where (schemaname || '.' || relname) = '$2'"
UserParameter=pgsql.table.stat.tidx_blks_read[*],psql -qAtX $1 -c "select coalesce(tidx_blks_read,0) from pg_statio_user_tables where (schemaname || '.' || relname) = '$2'"
UserParameter=pgsql.table.stat.tidx_blks_hit[*],psql -qAtX $1 -c "select coalesce(tidx_blks_hit,0) from pg_statio_user_tables where (schemaname || '.' || relname) = '$2'"
UserParameter=pgsql.table.stat.seq_scan[*],psql -qAtX $1 -c "select coalesce(seq_scan,0) from pg_stat_user_tables where (schemaname || '.' || relname) = '$2'"
UserParameter=pgsql.table.stat.seq_tup_read[*],psql -qAtX $1 -c "select coalesce(seq_tup_read,0) from pg_stat_user_tables where (schemaname || '.' || relname) = '$2'"
UserParameter=pgsql.table.stat.idx_scan[*],psql -qAtX $1 -c "select coalesce(idx_scan,0) from pg_stat_user_tables where (schemaname || '.' || relname) = '$2'"
UserParameter=pgsql.table.stat.idx_tup_fetch[*],psql -qAtX $1 -c "select coalesce(idx_tup_fetch,0) from pg_stat_user_tables where (schemaname || '.' || relname) = '$2'"
UserParameter=pgsql.table.stat.n_tup_ins[*],psql -qAtX $1 -c "select coalesce(n_tup_ins,0) from pg_stat_user_tables where (schemaname || '.' || relname) = '$2'"
UserParameter=pgsql.table.stat.n_tup_del[*],psql -qAtX $1 -c "select coalesce(n_tup_del,0) from pg_stat_user_tables where (schemaname || '.' || relname) = '$2'"
UserParameter=pgsql.table.stat.n_tup_upd[*],psql -qAtX $1 -c "select coalesce(n_tup_upd,0) from pg_stat_user_tables where (schemaname || '.' || relname) = '$2'"
UserParameter=pgsql.table.stat.n_tup_hot_upd[*],psql -qAtX $1 -c "select coalesce(n_tup_hot_upd,0) from pg_stat_user_tables where (schemaname || '.' || relname) = '$2'"
UserParameter=pgsql.table.stat.n_live_tup[*],psql -qAtX $1 -c "select coalesce(n_live_tup,0) from pg_stat_user_tables where (schemaname || '.' || relname) = '$2'"
UserParameter=pgsql.table.stat.n_dead_tup[*],psql -qAtX $1 -c "select coalesce(n_dead_tup,0) from pg_stat_user_tables where (schemaname || '.' || relname) = '$2'"
UserParameter=pgsql.table.stat.vacuum_count[*],psql -qAtX $1 -c "select coalesce(vacuum_count,0) from pg_stat_user_tables where (schemaname || '.' || relname) = '$2'"
UserParameter=pgsql.table.stat.autovacuum_count[*],psql -qAtX $1 -c "select coalesce(autovacuum_count,0) from pg_stat_user_tables where (schemaname || '.' || relname) = '$2'"
UserParameter=pgsql.table.stat.analyze_count[*],psql -qAtX $1 -c "select coalesce(analyze_count,0) from pg_stat_user_tables where (schemaname || '.' || relname) = '$2'"
UserParameter=pgsql.table.stat.autoanalyze_count[*],psql -qAtX $1 -c "select coalesce(autoanalyze_count,0) from pg_stat_user_tables where (schemaname || '.' || relname) = '$2'"

# STREAMING REPLICATION #
UserParameter=pgsql.streaming.count[*],psql -qAtX $1 -c "select count(*) from pg_stat_replication"
UserParameter=pgsql.streaming.state[*],psql -qAtX $1 -c "select pg_is_in_recovery()"
#UserParameter=pgsql.streaming.lag.bytes[*],psql -qAtX $1 -c "select greatest(0,pg_xlog_location_diff(pg_current_xlog_location(), replay_location)) from pg_stat_replication where client_addr = '$2'"
UserParameter=pgsql.streaming.lag.bytes[*],psql -qAtX $1 -c "select pg_wal_lsn_diff(sent_lsn,replay_lsn) from pg_stat_replication where client_addr = '$2';"
UserParameter=pgsql.streaming.lag.seconds[*],psql -qAtX -h $2 $1 -c "select extract(epoch from now() - pg_last_xact_replay_timestamp())"

导入temperature



    3.4
    2018-01-17T07:06:43Z
    
        
            EQUINIX.TESTE
        
    
    
        
    
    
        
            {PostgreSQL Simple Template:pgsql.transactions.active[{$PG_CONNINFO}].last()}>{$PG_LONG_QUERY_THRESHOLD}
            0
            
            PostgreSQL active transaction to long on {HOSTNAME} (time={ITEM.LASTVALUE})
            0
            
            
            0
            3
            
            0
            0
            
            
        
        
            {PostgreSQL Simple Template:pgsql.cache.hit[{$PG_CONNINFO}].last()}<{$PG_CACHE_HIT_RATIO}
            0
            
            PostgreSQL cache hit ratio too low on {HOSTNAME} ({ITEM.LASTVALUE})
            0
            
            
            0
            2
            
            0
            0
            
            
        
        
            {PostgreSQL Simple Template:pgsql.dbstat.sum.deadlocks[{$PG_CONNINFO}].last()}>{$PG_DEADLOCKS_THRESHOLD}
            0
            
            PostgreSQL deadlock occured on {HOSTNAME}
            0
            
            
            0
            3
            
            0
            0
            
            
        
        
            {PostgreSQL Simple Template:pgsql.connections.idle_in_transaction[{$PG_CONNINFO}].last()}>{$PG_CONN_IDLE_IN_TRANSACTION}
            0
            
            PostgreSQL idle in transaction connections to high on {HOSTNAME} ({ITEM.LASTVALUE})
            0
            
            
            0
            3
            
            0
            0
            
            
        
        
            {PostgreSQL Simple Template:pgsql.transactions.idle[{$PG_CONNINFO}].last()}>{$PG_LONG_QUERY_THRESHOLD}
            0
            
            PostgreSQL idle transaction to long on {HOSTNAME} ({ITEM.LASTVALUE})
            0
            
            
            0
            3
            
            0
            0
            
            
        
        
            {PostgreSQL Simple Template:pgsql.connections.waiting[{$PG_CONNINFO}].last()}>{$PG_CONN_WAITING}
            0
            
            PostgreSQL number of waiting connections to high on {HOSTNAME} ({ITEM.LASTVALUE})
            0
            
            
            0
            3
            
            0
            0
            
            
        
        
            {PostgreSQL Simple Template:pgsql.dbstat.sum.conflicts[{$PG_CONNINFO}].last()}>{$PG_CONFLICTS_THRESHOLD}
            0
            
            PostgreSQL recovery conflict occured on {HOSTNAME}
            0
            
            
            0
            3
            
            0
            0
            
            
        
        
            {PostgreSQL Simple Template:pgsql.bgwriter.checkpoints_req[{$PG_CONNINFO}].last()}>{$PG_CHECKPOINTS_REQ_THRESHOLD}
            0
            
            PostgreSQL required checkpoints occurs to frequently on {HOSTNAME}
            0
            
            
            0
            3
            
            0
            0
            
            
        
        
            {PostgreSQL Simple Template:pgsql.ping[{$PG_CONNINFO}].last()}>{$PG_PING_THRESHOLD_MS}
            0
            
            PostgreSQL response to long on {HOSTNAME} ({ITEM.LASTVALUE}
            0
            
            
            0
            3
            
            0
            0
            
            
        
        
            {PostgreSQL Simple Template:proc.num[{$PG_PROCESS_NAME}].last()}=0
            0
            
            PostgreSQL service not running on {HOSTNAME}
            0
            
            
            0
            4
            
            0
            0
            
            
        
        
            {PostgreSQL Simple Template:pgsql.uptime[{$PG_CONNINFO}].last()}<{$PG_UPTIME_THRESHOLD}
            0
            
            PostgreSQL service was restarted on {HOSTNAME} (uptime={ITEM.LASTVALUE})
            0
            
            
            0
            3
            
            0
            0
            
            
        
        
            {PostgreSQL Simple Template:pgsql.connections.total_pct[{$PG_CONNINFO}].last()}>{$PG_CONN_TOTAL_PCT}
            0
            
            PostgreSQL total number of connections to high on {HOSTNAME} ({ITEM.LASTVALUE})
            0
            
            
            0
            3
            
            0
            0
            
            
        
        
            {PostgreSQL Simple Template:pgsql.transactions.waiting[{$PG_CONNINFO}].last()}>{$PG_LONG_QUERY_THRESHOLD}
            0
            
            PostgreSQL waiting transaction to long on {HOSTNAME} ({ITEM.LASTVALUE})
            0
            
            
            0
            3
            
            0
            0
            
            
        
    
    
        
            PostgreSQL bgwriter
            900
            200
            0.0000
            100.0000
            1
            1
            0
            1
            0
            0.0000
            0.0000
            1
            0
            0
            0
            
                
                    0
                    0
                    00CC00
                    1
                    2
                    0
                    
                        PostgreSQL Simple Template
                        pgsql.bgwriter.buffers_alloc[{$PG_CONNINFO}]
                    
                
                
                    1
                    0
                    0000CC
                    1
                    2
                    0
                    
                        PostgreSQL Simple Template
                        pgsql.bgwriter.buffers_clean[{$PG_CONNINFO}]
                    
                
                
                    2
                    0
                    CC0000
                    1
                    2
                    0
                    
                        PostgreSQL Simple Template
                        pgsql.bgwriter.buffers_backend[{$PG_CONNINFO}]
                    
                
                
                    3
                    0
                    CCCC00
                    1
                    2
                    0
                    
                        PostgreSQL Simple Template
                        pgsql.bgwriter.buffers_checkpoint[{$PG_CONNINFO}]
                    
                
                
                    4
                    0
                    777777
                    0
                    2
                    0
                    
                        PostgreSQL Simple Template
                        pgsql.bgwriter.maxwritten_clean[{$PG_CONNINFO}]
                    
                
                
                    5
                    0
                    CC00CC
                    0
                    2
                    0
                    
                        PostgreSQL Simple Template
                        pgsql.bgwriter.buffers_backend_fsync[{$PG_CONNINFO}]
                    
                
            
        
        
            PostgreSQL buffers
            900
            200
            0.0000
            100.0000
            0
            0
            0
            1
            0
            0.0000
            0.0000
            0
            0
            0
            0
            
                
                    0
                    5
                    EEEEEE
                    1
                    2
                    0
                    
                        PostgreSQL Simple Template
                        pgsql.buffercache.total[{$PG_CONNINFO}]
                    
                
                
                    1
                    1
                    0000EE
                    1
                    2
                    0
                    
                        PostgreSQL Simple Template
                        pgsql.buffercache.used[{$PG_CONNINFO}]
                    
                
                
                    2
                    1
                    00EE00
                    1
                    2
                    0
                    
                        PostgreSQL Simple Template
                        pgsql.buffercache.clear[{$PG_CONNINFO}]
                    
                
                
                    3
                    1
                    EE0000
                    1
                    2
                    0
                    
                        PostgreSQL Simple Template
                        pgsql.buffercache.dirty[{$PG_CONNINFO}]
                    
                
            
        
        
            PostgreSQL checkpoints
            900
            200
            0.0000
            100.0000
            1
            1
            0
            1
            0
            0.0000
            0.0000
            1
            0
            0
            0
            
                
                    0
                    0
                    00CC00
                    0
                    2
                    0
                    
                        PostgreSQL Simple Template
                        pgsql.bgwriter.checkpoints_timed[{$PG_CONNINFO}]
                    
                
                
                    1
                    0
                    CC0000
                    0
                    2
                    0
                    
                        PostgreSQL Simple Template
                        pgsql.bgwriter.checkpoints_req[{$PG_CONNINFO}]
                    
                
                
                    2
                    0
                    000000
                    1
                    2
                    0
                    
                        PostgreSQL Simple Template
                        pgsql.bgwriter.checkpoint_sync_time[{$PG_CONNINFO}]
                    
                
                
                    3
                    0
                    0000CC
                    1
                    2
                    0
                    
                        PostgreSQL Simple Template
                        pgsql.bgwriter.checkpoint_write_time[{$PG_CONNINFO}]
                    
                
            
        
        
            PostgreSQL connections
            900
            200
            0.0000
            100.0000
            1
            1
            0
            1
            0
            0.0000
            0.0000
            1
            0
            0
            0
            
                
                    0
                    0
                    EEEEEE
                    1
                    2
                    0
                    
                        PostgreSQL Simple Template
                        pgsql.connections.total[{$PG_CONNINFO}]
                    
                
                
                    1
                    0
                    00BB00
                    1
                    2
                    0
                    
                        PostgreSQL Simple Template
                        pgsql.connections.active[{$PG_CONNINFO}]
                    
                
                
                    2
                    0
                    0000BB
                    1
                    2
                    0
                    
                        PostgreSQL Simple Template
                        pgsql.connections.idle[{$PG_CONNINFO}]
                    
                
                
                    3
                    0
                    CC00CC
                    1
                    2
                    0
                    
                        PostgreSQL Simple Template
                        pgsql.connections.idle_in_transaction[{$PG_CONNINFO}]
                    
                
                
                    4
                    0
                    BB0000
                    1
                    2
                    0
                    
                        PostgreSQL Simple Template
                        pgsql.connections.waiting[{$PG_CONNINFO}]
                    
                
                
                    5
                    0
                    888800
                    0
                    2
                    0
                    
                        PostgreSQL Simple Template
                        pgsql.connections.total_pct[{$PG_CONNINFO}]
                    
                
            
        
        
            PostgreSQL service response
            900
            200
            0.0000
            100.0000
            1
            1
            0
            1
            0
            0.0000
            0.0000
            0
            0
            0
            0
            
                
                    0
                    5
                    00CC00
                    1
                    2
                    0
                    
                        PostgreSQL Simple Template
                        pgsql.ping[{$PG_CONNINFO}]
                    
                
                
                    1
                    0
                    CC0000
                    1
                    2
                    0
                    
                        PostgreSQL Simple Template
                        pgsql.pgstatstatements.avg_query_time[{$PG_CONNINFO}]
                    
                
            
        
        
            PostgreSQL summary db stats: block hit/read
            900
            200
            0.0000
            100.0000
            1
            1
            0
            1
            0
            0.0000
            0.0000
            1
            0
            0
            0
            
                
                    0
                    0
                    00CC00
                    1
                    2
                    0
                    
                        PostgreSQL Simple Template
                        pgsql.dbstat.sum.blks_hit[{$PG_CONNINFO}]
                    
                
                
                    1
                    0
                    CC0000
                    1
                    2
                    0
                    
                        PostgreSQL Simple Template
                        pgsql.dbstat.sum.blks_read[{$PG_CONNINFO}]
                    
                
            
        
        
            PostgreSQL summary db stats: events
            900
            200
            0.0000
            100.0000
            1
            1
            0
            1
            0
            0.0000
            0.0000
            1
            0
            0
            0
            
                
                    0
                    5
                    00CC00
                    1
                    2
                    0
                    
                        PostgreSQL Simple Template
                        pgsql.dbstat.sum.xact_commit[{$PG_CONNINFO}]
                    
                
                
                    1
                    0
                    0000CC
                    1
                    2
                    0
                    
                        PostgreSQL Simple Template
                        pgsql.dbstat.sum.conflicts[{$PG_CONNINFO}]
                    
                
                
                    2
                    0
                    000000
                    1
                    2
                    0
                    
                        PostgreSQL Simple Template
                        pgsql.dbstat.sum.deadlocks[{$PG_CONNINFO}]
                    
                
                
                    3
                    0
                    CC0000
                    1
                    2
                    0
                    
                        PostgreSQL Simple Template
                        pgsql.dbstat.sum.xact_rollback[{$PG_CONNINFO}]
                    
                
            
        
        
            PostgreSQL summary db stats: temp files
            900
            200
            0.0000
            100.0000
            1
            1
            0
            1
            0
            0.0000
            0.0000
            1
            0
            0
            0
            
                
                    0
                    5
                    CC0000
                    0
                    2
                    0
                    
                        PostgreSQL Simple Template
                        pgsql.dbstat.sum.temp_bytes[{$PG_CONNINFO}]
                    
                
                
                    1
                    0
                    0000CC
                    1
                    2
                    0
                    
                        PostgreSQL Simple Template
                        pgsql.dbstat.sum.temp_files[{$PG_CONNINFO}]
                    
                
            
        
        
            PostgreSQL summary db stats: tuples
            900
            200
            0.0000
            100.0000
            1
            1
            0
            1
            0
            0.0000
            0.0000
            1
            0
            0
            0
            
                
                    0
                    0
                    000000
                    1
                    2
                    0
                    
                        PostgreSQL Simple Template
                        pgsql.dbstat.sum.tup_deleted[{$PG_CONNINFO}]
                    
                
                
                    1
                    0
                    00CC00
                    1
                    2
                    0
                    
                        PostgreSQL Simple Template
                        pgsql.dbstat.sum.tup_inserted[{$PG_CONNINFO}]
                    
                
                
                    2
                    0
                    CC0000
                    1
                    2
                    0
                    
                        PostgreSQL Simple Template
                        pgsql.dbstat.sum.tup_updated[{$PG_CONNINFO}]
                    
                
                
                    3
                    0
                    0000CC
                    1
                    2
                    0
                    
                        PostgreSQL Simple Template
                        pgsql.dbstat.sum.tup_fetched[{$PG_CONNINFO}]
                    
                
                
                    4
                    0
                    CC00CC
                    1
                    2
                    0
                    
                        PostgreSQL Simple Template
                        pgsql.dbstat.sum.tup_returned[{$PG_CONNINFO}]
                    
                
            
        
        
            PostgreSQL transactions
            900
            200
            0.0000
            100.0000
            1
            1
            0
            1
            0
            0.0000
            0.0000
            1
            0
            0
            0
            
                
                    0
                    0
                    00CC00
                    1
                    2
                    0
                    
                        PostgreSQL Simple Template
                        pgsql.transactions.active[{$PG_CONNINFO}]
                    
                
                
                    1
                    0
                    000000
                    1
                    2
                    0
                    
                        PostgreSQL Simple Template
                        pgsql.transactions.idle[{$PG_CONNINFO}]
                    
                
                
                    2
                    0
                    00CCCC
                    1
                    2
                    0
                    
                        PostgreSQL Simple Template
                        pgsql.transactions.prepared[{$PG_CONNINFO}]
                    
                
                
                    3
                    0
                    CC0000
                    1
                    2
                    0
                    
                        PostgreSQL Simple Template
                        pgsql.transactions.waiting[{$PG_CONNINFO}]
                    
                
            
        
        
            PostgreSQL uptime
            900
            200
            0.0000
            100.0000
            1
            1
            0
            1
            0
            0.0000
            0.0000
            1
            0
            0
            0
            
                
                    0
                    0
                    00CC00
                    0
                    2
                    0
                    
                        PostgreSQL Simple Template
                        pgsql.cache.hit[{$PG_CONNINFO}]
                    
                
                
                    1
                    0
                    0000CC
                    1
                    2
                    0
                    
                        PostgreSQL Simple Template
                        pgsql.uptime[{$PG_CONNINFO}]
                    
                
            
        
        
            PostgreSQL write-ahead log
            900
            200
            0.0000
            100.0000
            1
            1
            0
            1
            0
            0.0000
            0.0000
            1
            0
            0
            0
            
                
                    0
                    0
                    0000CC
                    1
                    2
                    0
                    
                        PostgreSQL Simple Template
                        pgsql.wal.count[{$PG_CONNINFO}]
                    
                
                
                    1
                    0
                    00CC00
                    0
                    2
                    0
                    
                        PostgreSQL Simple Template
                        pgsql.wal.write[{$PG_CONNINFO}]
                    
                
            
        
    

你可能感兴趣的:(postgresql10监控-使用EXTENSIONS模式)