From 8f7c72c29e20428b9d27e2f3a1ba9a58d6d65bb2 Mon Sep 17 00:00:00 2001 From: Samuel Smith Date: Tue, 8 Jul 2014 12:33:56 -0500 Subject: [PATCH] Added postgres_queries3_ to get stats on a per table basis --- plugins/postgresql/postgres_queries3_ | 111 ++++++++++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100755 plugins/postgresql/postgres_queries3_ diff --git a/plugins/postgresql/postgres_queries3_ b/plugins/postgresql/postgres_queries3_ new file mode 100755 index 00000000..7909383a --- /dev/null +++ b/plugins/postgresql/postgres_queries3_ @@ -0,0 +1,111 @@ +#!/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_table1-table2-table3 +# +# 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 +# + + +use strict; +use IPC::Run3 qw( run3 ); + + +my %values; + +my $query = \<