#!/usr/bin/env perl # postgres_queries3: see stats on number of rows # read, inserted, updated and deleted on a per table basis # # Author: # Samuel Smith leon36 gmail com # # Created: # 20140701 # # Usage: # Place in /etc/munin/plugins/ (or link it there using ln -s) # Place table names after '_' and delimit with '-' # EX: postgres_queries3_db1-db2-db3 # # Parameters: # config (required) # conf: # [postgres_*] # user postgres # # # General info: # Require permission for database access and read (no writes are processed). # Recommended user is PostgreSQL database owner. # On debian systems install libipc-run3-perl # # Log info: # 20140701 - Initial # 20140924 - # -ignore internal pg tables # -missing stuff in config use strict; use IPC::Run3 qw( run3 ); my %values; my $query = \<