From 801821cdad991a0c5a76f79bd204d921f3f56106 Mon Sep 17 00:00:00 2001 From: Ruslan Kabalin Date: Tue, 28 Jan 2014 16:03:28 +0000 Subject: [PATCH 001/272] Add pgbouncer_maxwait check Check how long the first (oldest) client in queue has been waiting. The suggested check is more comprehensive than pgb_pool_maxwait, it supports warning and critical time limits, exclude/include database options, output the details on affected clients in warning and critical states. --- check_postgres.pl | 132 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 132 insertions(+) diff --git a/check_postgres.pl b/check_postgres.pl index fae344f6..a6e492d1 100755 --- a/check_postgres.pl +++ b/check_postgres.pl @@ -198,6 +198,9 @@ package check_postgres; 'pgb-backends-msg' => q{$1 of $2 connections ($3%)}, 'pgb-backends-none' => q{No connections}, 'pgb-backends-users' => q{$1 for number of users must be a number or percentage}, + 'pgb-maxwait-msg' => q{longest wait: $1s}, + 'pgb-maxwait-nomatch'=> q{No matching rows were found}, + 'pgb-maxwait-skipped'=> q{No matching rows were found (skipped rows: $1)}, 'PID' => q{PID}, 'port' => q{port}, 'preptxn-none' => q{No prepared transactions found}, @@ -1167,6 +1170,7 @@ package check_postgres; pgb_pool_maxwait => [1, 'Check the current maximum wait time for client connections in pgbouncer pools.'], pgbouncer_backends => [0, 'Check how many clients are connected to pgbouncer compared to max_client_conn.'], pgbouncer_checksum => [0, 'Check that no pgbouncer settings have changed since the last check.'], + pgbouncer_maxwait => [0, 'Check how long the first (oldest) client in queue has been waiting.'], pgagent_jobs => [0, 'Check for no failed pgAgent jobs within a specified period of time.'], prepared_txns => [1, 'Checks number and age of prepared transactions.'], query_runtime => [0, 'Check how long a specific query takes to run.'], @@ -2012,6 +2016,9 @@ sub finishup { ## Check the current maximum wait time for client connections in pgbouncer pools check_pgb_pool('maxwait') if $action eq 'pgb_pool_maxwait'; +## Check how long the first (oldest) client in queue has been waiting. +check_pgbouncer_maxwait() if $action eq 'pgbouncer_maxwait'; + ## Check how many clients are connected to pgbouncer compared to max_client_conn. check_pgbouncer_backends() if $action eq 'pgbouncer_backends'; @@ -5630,6 +5637,107 @@ sub check_pgbouncer_checksum { } ## end of check_pgbouncer_checksum +sub check_pgbouncer_maxwait { + + ## Check how long the first (oldest) client in queue has waited, in + ## seconds. + ## Supports: Nagios, MRTG + ## Warning and critical are time limits - defaults to seconds + ## Valid units: s[econd], m[inute], h[our], d[ay] + ## All above may be written as plural as well (e.g. "2 hours") + ## Can also ignore databases with exclude and limit with include + + my $arg = shift || {}; + + my ($warning, $critical) = validate_range + ({ + type => 'time', + }); + + ## Grab information from the pg_stat_activity table + ## Since we clobber old info on a qtime "tie", use an ORDER BY + $SQL = qq{SHOW POOLS}; + + my $info = run_command($SQL, { regex => qr{\d+}, emptyok => 1 } ); + + ## Default values for information gathered + my ($maxwait, $database, $user, $cl_active, $cl_waiting) = + (0,'?','?',0,0); + + for $db (@{$info->{db}}) { + + ## Parse the psql output and gather stats from the winning row + ## Read in and parse the psql output + my $skipped = 0; + ROW: for my $r (@{$db->{slurp}}) { + + ## Apply --exclude and --include arguments to the database name + if (skip_item($r->{database})) { + $skipped++; + next ROW; + } + + ## Assign stats if we have a new winner + if ($r->{maxwait} > $maxwait) { + $database = $r->{database}; + $user = $r->{user}; + $cl_active = $r->{cl_active}; + $cl_waiting = $r->{cl_waiting}; + $maxwait = $r->{maxwait}; + } + } + + ## We don't really care why things matches as far as the final output + ## But it's nice to report what we can + if ($database eq '?') { + $MRTG and do_mrtg({one => 0, msg => 'No rows'}); + $db->{perf} = "0;$warning;$critical"; + + if ($skipped) { + add_ok msg('pgb-maxwait-skipped', $skipped); + } + else { + add_ok msg('pgb-maxwait-nomatch', $maxwait); + } + return; + } + + ## Details on who the offender was + my $whodunit = sprintf q{%s:%s %s:%s cl_active:%s cl_waiting:%s}, + msg('database'), + $database, + msg('username'), + $user, + $cl_active, + $cl_waiting; + + $MRTG and do_mrtg({one => $maxwait, msg => "$whodunit"}); + + $db->{perf} .= sprintf q{'%s'=%s;%s;%s}, + $whodunit, + $maxwait, + $warning, + $critical; + + my $m = msg('pgb-maxwait-msg', $maxwait); + my $msg = sprintf '%s (%s)', $m, $whodunit; + + if (length $critical and $maxwait >= $critical) { + add_critical $msg; + } + elsif (length $warning and $maxwait >= $warning) { + add_warning $msg; + } + else { + add_ok $msg; + } + } + + return; + + +} ## end of check_pgbouncer_maxwait + sub check_pgbouncer_backends { ## Check the number of connections to pgbouncer compared to @@ -9126,6 +9234,30 @@ =head2 B checksum must be provided as the C<--mrtg> argument. The fourth line always gives the current checksum. +=head2 B + +(C) Checks how long the first +(oldest) client in the queue has been waiting, in seconds. If this starts +increasing, then the current pool of servers does not handle requests quick +enough. Reason may be either overloaded server or just too small of a +pool_size setting in pbouncer config file. Databases can be filtered by use +of the I<--include> and I<--exclude> options. See the L +section for more details. The values or the I<--warning> and I<--critical> +options are units of time, and must be provided (no default). Valid units are +'seconds', 'minutes', 'hours', or 'days'. Each may be written singular or +abbreviated to just the first letter. If no units are given, the units are +assumed to be seconds. + +This action requires Postgres 8.3 or better. + +Example 1: Give a critical if any transaction has been open for more than 10 +minutes: + + check_postgres_pgbouncer_maxwait -p 6432 -u pgbouncer --critical='10 minutes' + +For MRTG output, returns the maximum time in seconds a transaction has been +open on the first line. The fourth line gives the name of the database. + =head2 B (C) Checks that all the pgAgent jobs From d14c46ba4529c2c5b6b3e3abd625e422cade2b96 Mon Sep 17 00:00:00 2001 From: Christoph Berg Date: Mon, 8 Sep 2014 17:05:35 +0200 Subject: [PATCH 002/272] Fix bloat check to use correct SQL depending on the server version. Previously it used the psql version which might differ when multiple versions are installed locally, or when querying remote servers. The hot_standby_delay check is also affected, but more involved to fix, so leave that for later. Adrian Vondendriesch --- check_postgres.pl | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/check_postgres.pl b/check_postgres.pl index 60e86c3b..2e6eb7a4 100755 --- a/check_postgres.pl +++ b/check_postgres.pl @@ -3623,14 +3623,10 @@ sub check_bloat { ## Alternate versions for old versions my $SQL2 = $SQL; - if ($psql_version <= 8.4) { - $SQL2 =~ s/AND s.inherited=false//; - } + $SQL2 =~ s/AND s.inherited=false//; # 8.4 and earlier my $SQL3 = $SQL2; - if ($psql_version <= 7.4) { - $SQL3 =~ s/SELECT current_setting.+?AS bs/(SELECT 8192) AS bs/; - } + $SQL3 =~ s/SELECT current_setting.+?AS bs/(SELECT 8192) AS bs/; # 7.4 and earlier my $info = run_command($SQL, { version => [ "<8.0 $SQL3", "<9.0 $SQL2" ] } ); @@ -4759,7 +4755,7 @@ sub check_hot_standby_delay { ## --warning='1048576 and 2min' --critical='16777216 and 10min' my ($warning, $wtime, $critical, $ctime) = validate_integer_for_time({default_to_int => 1}); - if ($psql_version < 9.1 and (length $wtime or length $ctime)) { + if ($psql_version < 9.1 and (length $wtime or length $ctime)) { # FIXME: check server version instead add_unknown msg('hs-time-version'); return; } @@ -9821,6 +9817,9 @@ =head1 HISTORY =item B + Fix bloat check to use correct SQL depending on the server version. + (Adrian Vondendriesch) + Add explicit ORDER BY to the slony_status check to get the most lagged server. (Jeff Frost) From 5cb4297143e846568de89e4d33c203298bbfd645 Mon Sep 17 00:00:00 2001 From: Greg Sabino Mullane Date: Thu, 30 Oct 2014 13:40:36 -0400 Subject: [PATCH 003/272] Quote values in error message when replicate_row fails --- check_postgres.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/check_postgres.pl b/check_postgres.pl index 2e6eb7a4..f68167cc 100755 --- a/check_postgres.pl +++ b/check_postgres.pl @@ -256,7 +256,7 @@ package check_postgres; 'rep-sourcefail' => q{Source update failed}, 'rep-timeout' => q{Row was not replicated. Timeout: $1}, 'rep-unknown' => q{Replication check failed}, - 'rep-wrongvals' => q{Cannot test replication: values are not the right ones ($1 not $2 nor $3)}, + 'rep-wrongvals' => q{Cannot test replication: values are not the right ones ('$1' not '$2' nor '$3')}, 'runcommand-err' => q{Unknown error inside of the "run_command" function}, 'runcommand-nodb' => q{No target databases could be found}, 'runcommand-nodupe' => q{Could not dupe STDERR}, @@ -509,7 +509,7 @@ package check_postgres; 'rep-sourcefail' => q{Échec de la mise à jour de la source}, 'rep-timeout' => q{La ligne n'a pas été répliquée. Délai dépassé : $1}, 'rep-unknown' => q{Échec du test de la réplication}, - 'rep-wrongvals' => q{Ne peut pas tester la réplication : les valeurs ne sont pas les bonnes (ni $1 ni $2 ni $3)}, + 'rep-wrongvals' => q{Ne peut pas tester la réplication : les valeurs ne sont pas les bonnes (ni '$1' ni '$2' ni '$3')}, 'runcommand-err' => q{Erreur inconnue de la fonction « run_command »}, 'runcommand-nodb' => q{Aucune base de données cible trouvée}, 'runcommand-nodupe' => q{N'a pas pu dupliqué STDERR}, From 900b0887df0f7367b33b0576102df1d8a937cef4 Mon Sep 17 00:00:00 2001 From: Greg Sabino Mullane Date: Thu, 30 Oct 2014 17:02:50 -0400 Subject: [PATCH 004/272] Merge dbname2, host2, etc. into the new array method. --- check_postgres.pl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/check_postgres.pl b/check_postgres.pl index f68167cc..a48e36fb 100755 --- a/check_postgres.pl +++ b/check_postgres.pl @@ -1001,22 +1001,22 @@ package check_postgres; if ($arg =~ /^\-?\-?(\w+)\s*=\s*(.+)/o) { my ($name,$value) = (lc $1, $2); if ($name =~ /^(?:db)?port(\d+)$/o or $name =~ /^p(\d+)$/o) { - $opt{"port$1"} = $value; + push @{ $opt{port} } => $value; } elsif ($name =~ /^(?:db)?host(\d+)$/o or $name =~ /^H(\d+)$/o) { - $opt{"host$1"} = $value; + push @{ $opt{host} } => $value; } elsif ($name =~ /^db(?:name)?(\d+)$/o) { - $opt{"dbname$1"} = $value; + push @{ $opt{dbname} } => $value; } elsif ($name =~ /^dbuser(\d+)$/o or $name =~ /^u(\d+)/o) { - $opt{"dbuser$1"} = $value; + push @{ $opt{dbuser} } => $value; } elsif ($name =~ /^dbpass(\d+)$/o) { - $opt{"dbpass$1"} = $value; + push @{ $opt{dbpass} } => $value; } elsif ($name =~ /^dbservice(\d+)$/o) { - $opt{"dbservice$1"} = $value; + push @{ $opt{dbservice} } => $value; } else { push @badargs => $arg; From c1122b675ae1e6b92422599b38aa52c055ffff3b Mon Sep 17 00:00:00 2001 From: Greg Sabino Mullane Date: Thu, 30 Oct 2014 17:09:10 -0400 Subject: [PATCH 005/272] Thanks a lot, Postgres. Now featuring whitespace in psql output that has never been there before. --- check_postgres.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/check_postgres.pl b/check_postgres.pl index a48e36fb..634fffef 100755 --- a/check_postgres.pl +++ b/check_postgres.pl @@ -2459,7 +2459,7 @@ sub run_command { $lnum++; next; } - if ($line =~ /^([\?\w]+)\s+\| (.*)/) { + if ($line =~ /^ ?([\?\w]+)\s+\| (.*)/) { $stuff[$lnum]{$1} = $2; $lastval = $1; } @@ -2488,7 +2488,7 @@ sub run_command { warn "OS: $^O\n"; warn "Action: $action\n"; warn "Calling line: $cline\n"; - warn "Output: $line\n"; + warn "Output: >>$line<<\n"; $args =~ s/ -c (.+)/ -c "$1"/s; warn "Command: $PSQL $args\n"; ## Next to last thing is to see if we can grab the PG version From 97e9af12d8f7d8d1b24c81f6acea514b0fbbe444 Mon Sep 17 00:00:00 2001 From: Greg Sabino Mullane Date: Thu, 30 Oct 2014 18:14:58 -0400 Subject: [PATCH 006/272] Grrr...account for trailing whitespace in psql table output --- check_postgres.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/check_postgres.pl b/check_postgres.pl index 634fffef..1893b62d 100755 --- a/check_postgres.pl +++ b/check_postgres.pl @@ -2459,7 +2459,7 @@ sub run_command { $lnum++; next; } - if ($line =~ /^ ?([\?\w]+)\s+\| (.*)/) { + if ($line =~ /^ ?([\?\w]+)\s+\| (.*?)\s*$/) { $stuff[$lnum]{$1} = $2; $lastval = $1; } From 4d80b4242055605ee4eef66159e0f8692e92aaeb Mon Sep 17 00:00:00 2001 From: Greg Sabino Mullane Date: Sat, 1 Nov 2014 12:17:18 -0400 Subject: [PATCH 007/272] Use Data::Dumper when showing full output on a failed parse, as this is more often than not a complex structure. --- check_postgres.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/check_postgres.pl b/check_postgres.pl index 1893b62d..a075d97c 100755 --- a/check_postgres.pl +++ b/check_postgres.pl @@ -2500,7 +2500,7 @@ sub run_command { warn "Postgres version: $v\n"; } ## This is a serious parsing fail, so it can be helpful to have the whole enchilada: - warn "Full output: $db->{slurp}\n\n"; + warn 'Full output: ' . (Dumper $db->{slurp}) . "\n\n"; exit 1; } } From 819a956d7c2090b69780b35c102cce73d73e15ac Mon Sep 17 00:00:00 2001 From: Greg Sabino Mullane Date: Sat, 1 Nov 2014 12:47:52 -0400 Subject: [PATCH 008/272] Tweak test, as the output no longer ends where it used to --- t/02_txn_idle.t | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/02_txn_idle.t b/t/02_txn_idle.t index 89e50f68..0f841a3b 100644 --- a/t/02_txn_idle.t +++ b/t/02_txn_idle.t @@ -68,7 +68,7 @@ sleep(1); like ($cp->run(q{-w 0}), qr{longest idle in txn: \d+s}, $t); $t .= ' (MRTG)'; -like ($cp->run(q{--output=mrtg -w 0}), qr{\d+\n0\n\nPID:\d+ database:$dbname username:check_postgres_testing\n}, $t); +like ($cp->run(q{--output=mrtg -w 0}), qr{\d+\n0\n\nPID:\d+ database:$dbname username:check_postgres_testing}, $t); sleep(1); From 5a5cf9ffc53207517aadc3f2619ce4f6cb82c8f5 Mon Sep 17 00:00:00 2001 From: Greg Sabino Mullane Date: Sat, 1 Nov 2014 12:48:49 -0400 Subject: [PATCH 009/272] Allow optional space before 'QUERY PLAN' --- check_postgres.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/check_postgres.pl b/check_postgres.pl index a075d97c..5f78bbb8 100755 --- a/check_postgres.pl +++ b/check_postgres.pl @@ -2463,7 +2463,7 @@ sub run_command { $stuff[$lnum]{$1} = $2; $lastval = $1; } - elsif ($line =~ /^QUERY PLAN\s+\| (.*)/) { + elsif ($line =~ /^ ?QUERY PLAN\s+\| (.*)/) { $stuff[$lnum]{queryplan} = $1; $lastval = 'queryplan'; } From 0c19c9ca42277c8aae1883c54e2148c113cf0693 Mon Sep 17 00:00:00 2001 From: Christoph Moench-Tegeder Date: Wed, 7 Jan 2015 16:44:58 +0100 Subject: [PATCH 010/272] in check_bloat(), fix MINPAGES and MINIPAGES make sure the bloat check's minimum size requirements for tables and indexes match the documentation. --- check_postgres.pl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/check_postgres.pl b/check_postgres.pl index 5f78bbb8..cc9aaf91 100755 --- a/check_postgres.pl +++ b/check_postgres.pl @@ -3526,8 +3526,8 @@ sub check_bloat { ## Can also specify percentages ## Don't bother with tables or indexes unless they have at least this many bloated pages - my $MINPAGES = 0; - my $MINIPAGES = 10; + my $MINPAGES = 10; + my $MINIPAGES = 15; my $LIMIT = 10; if ($opt{perflimit}) { From 27ad631cfd13b270ba8ae61f8a8ebbd222c47790 Mon Sep 17 00:00:00 2001 From: Giles Westwood Date: Mon, 2 Mar 2015 16:21:59 +0000 Subject: [PATCH 011/272] adding an option to pre-populate the database list with all available databases, used for bloat check --- check_postgres.pl | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/check_postgres.pl b/check_postgres.pl index 5f78bbb8..3db33074 100755 --- a/check_postgres.pl +++ b/check_postgres.pl @@ -959,6 +959,9 @@ package check_postgres; 'critical=s', 'include=s@', 'exclude=s@', + 'alldb', + 'includedb=s@', + 'excludedb=s@', 'includeuser=s@', 'excludeuser=s@', @@ -1222,6 +1225,9 @@ package check_postgres; -c value, --critical=value the critical threshold, range depends on the action --include=name(s) items to specifically include (e.g. tables), depends on the action --exclude=name(s) items to specifically exclude (e.g. tables), depends on the action + --alldb list all postgres databases and run action over them + --excludedb=name regex filter for the alldb option to select only certain databases + --includedb=name regex filter for the alldb option to select only certain databases --includeuser=include objects owned by certain users --excludeuser=exclude objects owned by certain users @@ -1364,6 +1370,44 @@ sub msg_en { $opt{defaultdb} = $psql_version >= 8.0 ? 'postgres' : 'template1'; $opt{defaultdb} = 'pgbouncer' if $action =~ /^pgb/; +## If alldb is set then run a psql command to find out all the databases +if (defined $opt{alldb}){ + + my $pg_port = $opt{defaultport}; + if ($opt{port}[0]){ + $pg_port = $opt{port}[0]; + } + my $psql_output = join(",", map /^([\w|-]+?)\|/, qx{$PSQL -A -l -t -p $pg_port }); + my $pg_db; + # optionally exclude or include each db + my @psql_output_array = split(/,/, $psql_output); + for $pg_db (@psql_output_array) { + if (defined $opt{includedb}){ + if ($pg_db =~ /$opt{includedb}[0]/) { + # do nothing + } else { + # strip the database from the listing + $psql_output =~ s/($pg_db),//; + } + } + if (defined $opt{excludedb}){ + if ($pg_db =~ /$opt{excludedb}[0]/) { + # strip the database from the listing + $psql_output =~ s/($pg_db),//; + } else { + # do nothing + } + } + } + # strip out some dbs we're not interested in + $psql_output =~ s/(template0,)//; + $psql_output =~ s/(root,)//; + # pg8.4 + $psql_output =~ s/(,:)//g; + $opt{dbname}[0] = $psql_output; +} + + ## Check the current database mode our $STANDBY = 0; our $MASTER = 0; From f069af5d60587c93efd7c190706f08b81d6fad1f Mon Sep 17 00:00:00 2001 From: Christoph Berg Date: Mon, 23 Mar 2015 15:52:49 +0100 Subject: [PATCH 012/272] Query all sequences per DB in parallel for action=sequence action=sequence used to open a new session for every sequence checked, which could be very slow. Fix by creating a single SQL statement using UNION ALL to query all sequences at once. --- check_postgres.pl | 19 ++++++++++++------- t/02_sequence.t | 15 ++++++++++++++- t/CP_Testing.pm | 3 ++- 3 files changed, 28 insertions(+), 9 deletions(-) diff --git a/check_postgres.pl b/check_postgres.pl index 5f78bbb8..fbffae2c 100755 --- a/check_postgres.pl +++ b/check_postgres.pl @@ -7274,12 +7274,15 @@ sub check_sequence { my %seqinfo; my %seqperf; my $multidb = @{$info->{db}} > 1 ? "$db->{dbname}." : ''; - for my $r (@{$db->{slurp}}) { + my @seq_sql; + for my $r (@{$db->{slurp}}) { # for each sequence, create SQL command to inspect it my ($schema, $seq, $seqname, $typename) = @$r{qw/ nspname seqname safename typname /}; next if skip_item($seq); my $maxValue = $typename eq 'int2' ? $MAXINT2 : $typename eq 'int4' ? $MAXINT4 : $MAXINT8; - $SQL = qq{ -SELECT last_value, slots, used, ROUND(used/slots*100) AS percent, + my $seqname_l = $seqname; + $seqname_l =~ s/'/''/g; # SQL literal quoting (name is already identifier-quoted) + push @seq_sql, qq{ +SELECT '$seqname_l' AS seqname, last_value, slots, used, ROUND(used/slots*100) AS percent, CASE WHEN slots < used THEN 0 ELSE slots - used END AS numleft FROM ( SELECT last_value, @@ -7287,10 +7290,10 @@ sub check_sequence { CEIL((last_value-min_value::numeric+1)/increment_by::NUMERIC) AS used FROM $seqname) foo }; - - my $seqinfo = run_command($SQL, { target => $db }); - my $r2 = $seqinfo->{db}[0]{slurp}[0]; - my ($last, $slots, $used, $percent, $left) = @$r2{qw/ last_value slots used percent numleft / }; + } + my $seqinfo = run_command(join("\nUNION ALL\n", @seq_sql), { target => $db }); # execute all SQL commands at once + for my $r2 (@{$seqinfo->{db}[0]{slurp}}) { # now look at all results + my ($seqname, $last, $slots, $used, $percent, $left) = @$r2{qw/ seqname last_value slots used percent numleft / }; if (! defined $last) { ndie msg('seq-die', $seqname); } @@ -9825,6 +9828,8 @@ =head1 HISTORY Declare POD encoding to be utf8. (Christoph Berg) + Query all sequences per DB in parallel for action=sequence. (Christoph Berg) + =item B September 24, 2013 Fix issue with SQL steps in check_pgagent_jobs for sql steps which perform deletes diff --git a/t/02_sequence.t b/t/02_sequence.t index d42187f6..b1fa3ea3 100644 --- a/t/02_sequence.t +++ b/t/02_sequence.t @@ -6,7 +6,7 @@ use 5.006; use strict; use warnings; use Data::Dumper; -use Test::More tests => 10; +use Test::More tests => 12; use lib 't','.'; use CP_Testing; @@ -45,6 +45,7 @@ if ($ver < 80100) { my $seqname = 'cp_test_sequence'; $cp->drop_sequence_if_exists($seqname); $cp->drop_sequence_if_exists("${seqname}2"); +$cp->drop_sequence_if_exists("${seqname}'\"evil"); $t=qq{$S works when no sequences exist}; like ($cp->run(''), qr{OK:.+No sequences found}, $t); @@ -83,4 +84,16 @@ like ($cp->run('--critical=22%'), qr{CRITICAL:.+public.cp_test_sequence=33% \(ca $t=qq{$S returns correct information with MRTG output}; is ($cp->run('--critical=22% --output=mrtg'), "33\n0\n\npublic.cp_test_sequence\n", $t); +# create second sequence +$dbh->do("CREATE SEQUENCE ${seqname}2"); +$dbh->commit(); +$t=qq{$S returns correct information for two sequences}; +like ($cp->run(''), qr{OK:.+public.cp_test_sequence=33% .* \| .*${seqname}=33%.*${seqname}2=0%}, $t); + +# test SQL quoting +$dbh->do(qq{CREATE SEQUENCE "${seqname}'""evil"}); +$dbh->commit(); +$t=qq{$S handles SQL quoting}; +like ($cp->run(''), qr{OK:.+'public."${seqname}''""evil"'}, $t); # extra " and ' because name is both identifier+literal quoted + exit; diff --git a/t/CP_Testing.pm b/t/CP_Testing.pm index 28ff60b3..c473c9f7 100644 --- a/t/CP_Testing.pm +++ b/t/CP_Testing.pm @@ -700,7 +700,8 @@ sub drop_sequence_if_exists { $SQL = q{SELECT count(*) FROM pg_class WHERE relkind = 'S' AND relname = } . $dbh->quote($name); my $count = $dbh->selectall_arrayref($SQL)->[0][0]; if ($count) { - $dbh->do("DROP SEQUENCE $name"); + $name =~ s/"/""/g; + $dbh->do("DROP SEQUENCE \"$name\""); $dbh->commit(); } return; From c2d15dafc62c3a7498a10cf28f4e6c0fc1340987 Mon Sep 17 00:00:00 2001 From: Christoph Berg Date: Mon, 23 Mar 2015 16:38:18 +0100 Subject: [PATCH 013/272] Add tests for "serial" and "smallserial" columns The code was already there, but not covered by tests --- t/02_sequence.t | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/t/02_sequence.t b/t/02_sequence.t index b1fa3ea3..efce3a02 100644 --- a/t/02_sequence.t +++ b/t/02_sequence.t @@ -6,7 +6,7 @@ use 5.006; use strict; use warnings; use Data::Dumper; -use Test::More tests => 12; +use Test::More tests => 14; use lib 't','.'; use CP_Testing; @@ -43,9 +43,11 @@ if ($ver < 80100) { my $seqname = 'cp_test_sequence'; +my $testtbl = 'sequence_test'; $cp->drop_sequence_if_exists($seqname); $cp->drop_sequence_if_exists("${seqname}2"); $cp->drop_sequence_if_exists("${seqname}'\"evil"); +$cp->drop_table_if_exists("$testtbl"); $t=qq{$S works when no sequences exist}; like ($cp->run(''), qr{OK:.+No sequences found}, $t); @@ -96,4 +98,28 @@ $dbh->commit(); $t=qq{$S handles SQL quoting}; like ($cp->run(''), qr{OK:.+'public."${seqname}''""evil"'}, $t); # extra " and ' because name is both identifier+literal quoted +$dbh->do("DROP SEQUENCE ${seqname}"); +$dbh->do("DROP SEQUENCE ${seqname}2"); +$dbh->do(qq{DROP SEQUENCE "${seqname}'""evil"}); + +# test integer column where the datatype range is smaller than the serial range +$dbh->do("CREATE TABLE $testtbl (id serial)"); +$dbh->do("SELECT setval('${testtbl}_id_seq',2000000000)"); +$dbh->commit; +$t=qq{$S handles "serial" column}; +like ($cp->run(''), qr{WARNING:.+public.sequence_test_id_seq=93% \(calls left=147483647\)}, $t); + +if ($ver >= 90200) { + # test smallint column where the datatype range is even smaller (and while we are at it, test --exclude) + $dbh->do("ALTER TABLE $testtbl ADD COLUMN smallid smallserial"); + $dbh->do("SELECT setval('${testtbl}_smallid_seq',30000)"); + $dbh->commit; + $t=qq{$S handles "smallserial" column}; + like ($cp->run('--exclude=sequence_test_id_seq'), qr{WARNING:.+public.sequence_test_smallid_seq=92% \(calls left=2767\)}, $t); +} else { + SKIP: { + skip '"smallserial" needs PostgreSQL 9.2 or later', 2; + } +} + exit; From e3d43fece536cb8a5d5c717b7fb2843e8b576bcb Mon Sep 17 00:00:00 2001 From: glynastill Date: Fri, 20 Dec 2013 13:16:43 +0000 Subject: [PATCH 014/272] Change the way tables are quoted in replicate_row. Change the way tables are quoted in replicate_row to allow for tables with schema name. --- check_postgres.pl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/check_postgres.pl b/check_postgres.pl index fbffae2c..e1915ace 100755 --- a/check_postgres.pl +++ b/check_postgres.pl @@ -6149,7 +6149,7 @@ sub check_replicate_row { my ($table,$pk,$id,$col,$val1,$val2) = (@repinfo); ## Quote everything, just to be safe (e.g. columns named 'desc') - $table = qq{"$table"}; + $table =~ s/([^\.]+)/\"$1\"/g; $pk = qq{"$pk"}; $col = qq{"$col"}; From 7d56cc7dad04b05d965a28aa05764bc08314f166 Mon Sep 17 00:00:00 2001 From: glyn Date: Wed, 15 Apr 2015 10:53:31 +0100 Subject: [PATCH 015/272] Fix issues with latest changes to check_sequence and run_command: check_sequence - Split big UNION of sequence selects into chunks to avoid overrunning system argument size run_command - If we have specified a "target" database, skip all others in global targetdb list --- check_postgres.pl | 52 ++++++++++++++++++++++++++--------------------- 1 file changed, 29 insertions(+), 23 deletions(-) diff --git a/check_postgres.pl b/check_postgres.pl index e1915ace..a702ee43 100755 --- a/check_postgres.pl +++ b/check_postgres.pl @@ -2254,6 +2254,10 @@ sub run_command { if ($arg->{dbnumber} and $arg->{dbnumber} != $num) { next; } + ## Likewise if we have specified "target" database info and this is not our choice + if ($arg->{target} and $arg->{target} != $db) { + next; + } ## Just to keep things clean: truncate $tempfh, 0; @@ -7291,30 +7295,34 @@ sub check_sequence { FROM $seqname) foo }; } - my $seqinfo = run_command(join("\nUNION ALL\n", @seq_sql), { target => $db }); # execute all SQL commands at once - for my $r2 (@{$seqinfo->{db}[0]{slurp}}) { # now look at all results - my ($seqname, $last, $slots, $used, $percent, $left) = @$r2{qw/ seqname last_value slots used percent numleft / }; - if (! defined $last) { - ndie msg('seq-die', $seqname); - } - my $msg = msg('seq-msg', $seqname, $percent, $left); - my $nicename = perfname("$multidb$seqname"); - $seqperf{$percent}{$seqname} = [$left, " $nicename=$percent%;$w%;$c%"]; - if ($percent >= $maxp) { - $maxp = $percent; - if (! exists $opt{perflimit} or $limit++ < $opt{perflimit}) { - push @{$seqinfo{$percent}} => $MRTG ? [$seqname,$percent,$slots,$used,$left] : $msg; + # Use UNION ALL to query multiple sequences at once, however if there are too many sequences this can exceed + # maximum argument length; so split into chunks of 200 sequences or less and iterate over them. + while (my @seq_sql_chunk = splice @seq_sql, 0, 200) { + my $seqinfo = run_command(join("\nUNION ALL\n", @seq_sql_chunk), { target => $db }); # execute all SQL commands at once + for my $r2 (@{$seqinfo->{db}[0]{slurp}}) { # now look at all results + my ($seqname, $last, $slots, $used, $percent, $left) = @$r2{qw/ seqname last_value slots used percent numleft / }; + if (! defined $last) { + ndie msg('seq-die', $seqname); } - } - next if $MRTG; + my $msg = msg('seq-msg', $seqname, $percent, $left); + my $nicename = perfname("$multidb$seqname"); + $seqperf{$percent}{$seqname} = [$left, " $nicename=$percent%;$w%;$c%"]; + if ($percent >= $maxp) { + $maxp = $percent; + if (! exists $opt{perflimit} or $limit++ < $opt{perflimit}) { + push @{$seqinfo{$percent}} => $MRTG ? [$seqname,$percent,$slots,$used,$left] : $msg; + } + } + next if $MRTG; - if (length $critical and $percent >= $c) { - push @crit => $msg; - } - elsif (length $warning and $percent >= $w) { - push @warn => $msg; + if (length $critical and $percent >= $c) { + push @crit => $msg; + } + elsif (length $warning and $percent >= $w) { + push @warn => $msg; + } } - } + } if ($MRTG) { my $msg = join ' | ' => map { $_->[0] } @{$seqinfo{$maxp}}; do_mrtg({one => $maxp, msg => $msg}); @@ -7958,8 +7966,6 @@ sub check_wal_files { } ## end of check_wal_files - - =pod =encoding utf8 From da35d417cabd4585cd2db1d00b78e07e31cf43e6 Mon Sep 17 00:00:00 2001 From: Greg Sabino Mullane Date: Thu, 7 May 2015 23:54:00 -0400 Subject: [PATCH 016/272] Bump copyright --- README | 4 ++-- check_postgres.pl | 2 +- check_postgres.pl.html | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README b/README index 82028cae..9063c8dd 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -check_postgres is Copyright (C) 2007-2013, Greg Sabino Mullane +check_postgres is Copyright (C) 2007-2015, Greg Sabino Mullane This is check_postgres, a monitoring tool for Postgres. @@ -76,7 +76,7 @@ https://mail.endcrypt.com/mailman/listinfo/check_postgres-commit COPYRIGHT: ---------- - Copyright (c) 2007-2013 Greg Sabino Mullane + Copyright (c) 2007-2015 Greg Sabino Mullane LICENSE INFORMATION: diff --git a/check_postgres.pl b/check_postgres.pl index a702ee43..f8da6b8a 100755 --- a/check_postgres.pl +++ b/check_postgres.pl @@ -10555,7 +10555,7 @@ =head1 NAGIOS EXAMPLES =head1 LICENSE AND COPYRIGHT -Copyright (c) 2007-2013 Greg Sabino Mullane . +Copyright (c) 2007-2015 Greg Sabino Mullane . Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/check_postgres.pl.html b/check_postgres.pl.html index 9ba2625b..d06da4cc 100644 --- a/check_postgres.pl.html +++ b/check_postgres.pl.html @@ -2703,7 +2703,7 @@

NAGIOS EXAMPLES


LICENSE AND COPYRIGHT

-

Copyright (c) 2007-2013 Greg Sabino Mullane <greg@endpoint.com>.

+

Copyright (c) 2007-2015 Greg Sabino Mullane <greg@endpoint.com>.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:


From 4cea93ea51fceb532c4b07b70c18eeb412aaeed7 Mon Sep 17 00:00:00 2001
From: Greg Sabino Mullane 
Date: Tue, 26 May 2015 22:02:30 -0400
Subject: [PATCH 017/272] Remove tabs, cleanup whitespace

---
 check_postgres.pl | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/check_postgres.pl b/check_postgres.pl
index f8da6b8a..a7a2a767 100755
--- a/check_postgres.pl
+++ b/check_postgres.pl
@@ -2254,10 +2254,10 @@ sub run_command {
         if ($arg->{dbnumber} and $arg->{dbnumber} != $num) {
             next;
         }
-	## Likewise if we have specified "target" database info and this is not our choice
-	if ($arg->{target} and $arg->{target} != $db) {
+        ## Likewise if we have specified "target" database info and this is not our choice
+        if ($arg->{target} and $arg->{target} != $db) {
             next;
-	}
+        }
 
         ## Just to keep things clean:
         truncate $tempfh, 0;
@@ -7295,9 +7295,9 @@ sub check_sequence {
 FROM $seqname) foo
 };
         }
-	# Use UNION ALL to query multiple sequences at once, however if there are too many sequences this can exceed
+        # Use UNION ALL to query multiple sequences at once, however if there are too many sequences this can exceed
         # maximum argument length; so split into chunks of 200 sequences or less and iterate over them.
-	while (my @seq_sql_chunk = splice @seq_sql, 0, 200) {
+        while (my @seq_sql_chunk = splice @seq_sql, 0, 200) {
             my $seqinfo = run_command(join("\nUNION ALL\n", @seq_sql_chunk), { target => $db }); # execute all SQL commands at once
             for my $r2 (@{$seqinfo->{db}[0]{slurp}}) { # now look at all results
                 my ($seqname, $last, $slots, $used, $percent, $left) = @$r2{qw/ seqname last_value slots used percent numleft / };
@@ -7322,7 +7322,7 @@ sub check_sequence {
                     push @warn => $msg;
                 }
             }
-	}
+        }
         if ($MRTG) {
             my $msg = join ' | ' => map { $_->[0] } @{$seqinfo{$maxp}};
             do_mrtg({one => $maxp, msg => $msg});

From 776408aab47f29e4f7f47bf4d515671d7736ab08 Mon Sep 17 00:00:00 2001
From: Greg Sabino Mullane 
Date: Tue, 23 Jun 2015 09:09:07 -0400
Subject: [PATCH 018/272] Version bump.

---
 check_postgres.pl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/check_postgres.pl b/check_postgres.pl
index a7a2a767..df143576 100755
--- a/check_postgres.pl
+++ b/check_postgres.pl
@@ -32,7 +32,7 @@ package check_postgres;
 
 binmode STDOUT, ':encoding(UTF-8)';
 
-our $VERSION = '2.21.0';
+our $VERSION = '2.21.1';
 
 use vars qw/ %opt $PGBINDIR $PSQL $res $COM $SQL $db /;
 

From 51c6991862c9b24da0bfaa5917c1597db12ff495 Mon Sep 17 00:00:00 2001
From: Greg Sabino Mullane 
Date: Tue, 23 Jun 2015 09:16:26 -0400
Subject: [PATCH 019/272] Update release notes a bit

---
 check_postgres.pl | 34 +++++++++++++++++++++++++++++-----
 1 file changed, 29 insertions(+), 5 deletions(-)

diff --git a/check_postgres.pl b/check_postgres.pl
index df143576..42f1ab07 100755
--- a/check_postgres.pl
+++ b/check_postgres.pl
@@ -7974,7 +7974,7 @@ =head1 NAME
 
 B - a Postgres monitoring script for Nagios, MRTG, Cacti, and others
 
-This documents describes check_postgres.pl version 2.21.0
+This documents describes check_postgres.pl version 2.21.1
 
 =head1 SYNOPSIS
 
@@ -9832,20 +9832,44 @@ =head1 HISTORY
   Add explicit ORDER BY to the slony_status check to get the most lagged server.
     (Jeff Frost)
 
-  Declare POD encoding to be utf8. (Christoph Berg)
+  Change the way tables are quoted in replicate_row.
+    (Glyn Astill)
 
-  Query all sequences per DB in parallel for action=sequence. (Christoph Berg)
+  Improved multi-slave support in replicate_row.
+    (Andrew Yochum)
+
+  Add xact timestamp support to hot_standby_delay.
+  Allow the hot_standby_delay check to accept xlog byte position or
+  timestamp lag intervals as thresholds, or even both at the same time.
+    (Josh Williams)
+
+  Fix and extend hot_standby_delay documentation
+    (Michael Renner)
+
+  Don't swallow space before the -c flag when reporting errors
+    (Jeff Janes)
+
+  Show actual long-running query in query_time output
+    (Peter Eisentraut)
+
+  Declare POD encoding to be utf8.
+    (Christoph Berg)
+
+  Query all sequences per DB in parallel for action=sequence.
+    (Christoph Berg)
 
 =item B September 24, 2013
 
   Fix issue with SQL steps in check_pgagent_jobs for sql steps which perform deletes
     (Rob Emery via github pull)
 
-  Install man page in section 1. (Peter Eisentraut, bug 53, github issue 26)
+  Install man page in section 1.
+    (Peter Eisentraut, bug 53, github issue 26)
 
   Order lock types in check_locks output to make the ordering predictable;
   setting SKIP_NETWORK_TESTS will skip the new_version tests; other minor test
-  suite fixes. (Christoph Berg)
+  suite fixes.
+    (Christoph Berg)
 
   Fix same_schema check on 9.3 by ignoring relminmxid differences in pg_class
     (Christoph Berg)

From 791a17ff1b662b1b6d4d3e5261bfdc3aac313731 Mon Sep 17 00:00:00 2001
From: Christoph Berg 
Date: Tue, 23 Jun 2015 16:26:10 +0200
Subject: [PATCH 020/272] Fix t/02_sequence.t for PG 9.0/1

---
 t/02_sequence.t | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/t/02_sequence.t b/t/02_sequence.t
index efce3a02..1111d895 100644
--- a/t/02_sequence.t
+++ b/t/02_sequence.t
@@ -118,7 +118,7 @@ if ($ver >= 90200) {
     like ($cp->run('--exclude=sequence_test_id_seq'), qr{WARNING:.+public.sequence_test_smallid_seq=92% \(calls left=2767\)}, $t);
 } else {
     SKIP: {
-        skip '"smallserial" needs PostgreSQL 9.2 or later', 2;
+        skip '"smallserial" needs PostgreSQL 9.2 or later', 1;
     }
 }
 

From 60af9f27721d62219a5ef220feff02ae7e8b79b1 Mon Sep 17 00:00:00 2001
From: Christoph Berg 
Date: Tue, 23 Jun 2015 16:35:31 +0200
Subject: [PATCH 021/272] Fix txn_time regression test for 9.0/9.1

Newer versions will show the last or current query here, older versions
will just show " in transaction" if there is currently no
query running.
---
 t/02_txn_time.t | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/t/02_txn_time.t b/t/02_txn_time.t
index 8be2fa18..d743fe1f 100644
--- a/t/02_txn_time.t
+++ b/t/02_txn_time.t
@@ -76,7 +76,8 @@ sleep(1);
 like ($cp->run(q{-w 0}), qr{longest txn: 1s}, $t);
 
 $t .= ' (MRTG)';
-like ($cp->run(q{--output=mrtg -w 0}), qr{\d+\n0\n\nPID:\d+ database:$dbname username:\w+ query:SELECT 1\n}, $t);
+my $query_patten = ($ver >= 90200) ? "SELECT 1" : " in transaction";
+like ($cp->run(q{--output=mrtg -w 0}), qr{\d+\n0\n\nPID:\d+ database:$dbname username:\w+ query:$query_patten\n}, $t);
 
 $idle_dbh->commit;
 

From efcff69ea7678ec264e814b3e515a09d1674db87 Mon Sep 17 00:00:00 2001
From: Greg Sabino Mullane 
Date: Fri, 26 Jun 2015 08:52:32 -0400
Subject: [PATCH 022/272] Rearrange recent changes in rough priority order

---
 check_postgres.pl | 30 +++++++++++++++---------------
 1 file changed, 15 insertions(+), 15 deletions(-)

diff --git a/check_postgres.pl b/check_postgres.pl
index 42f1ab07..6bb63d31 100755
--- a/check_postgres.pl
+++ b/check_postgres.pl
@@ -9826,38 +9826,38 @@ =head1 HISTORY
 
 =item B
 
+  Add xact timestamp support to hot_standby_delay.
+  Allow the hot_standby_delay check to accept xlog byte position or
+  timestamp lag intervals as thresholds, or even both at the same time.
+    (Josh Williams)
+
+  Query all sequences per DB in parallel for action=sequence.
+    (Christoph Berg)
+
   Fix bloat check to use correct SQL depending on the server version.
     (Adrian Vondendriesch)
 
+  Show actual long-running query in query_time output
+    (Peter Eisentraut)
+
   Add explicit ORDER BY to the slony_status check to get the most lagged server.
     (Jeff Frost)
 
-  Change the way tables are quoted in replicate_row.
-    (Glyn Astill)
-
   Improved multi-slave support in replicate_row.
     (Andrew Yochum)
 
-  Add xact timestamp support to hot_standby_delay.
-  Allow the hot_standby_delay check to accept xlog byte position or
-  timestamp lag intervals as thresholds, or even both at the same time.
-    (Josh Williams)
-
-  Fix and extend hot_standby_delay documentation
-    (Michael Renner)
+  Change the way tables are quoted in replicate_row.
+    (Glyn Astill)
 
   Don't swallow space before the -c flag when reporting errors
     (Jeff Janes)
 
-  Show actual long-running query in query_time output
-    (Peter Eisentraut)
+  Fix and extend hot_standby_delay documentation
+    (Michael Renner)
 
   Declare POD encoding to be utf8.
     (Christoph Berg)
 
-  Query all sequences per DB in parallel for action=sequence.
-    (Christoph Berg)
-
 =item B September 24, 2013
 
   Fix issue with SQL steps in check_pgagent_jobs for sql steps which perform deletes

From d2412d5125ac991252f09ddf0aac17674feec10d Mon Sep 17 00:00:00 2001
From: Greg Sabino Mullane 
Date: Fri, 26 Jun 2015 09:18:02 -0400
Subject: [PATCH 023/272] Spelling

---
 check_postgres.pl | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/check_postgres.pl b/check_postgres.pl
index 6bb63d31..2fd53ec4 100755
--- a/check_postgres.pl
+++ b/check_postgres.pl
@@ -8857,7 +8857,7 @@ =head2 B
 to it. The slave server must be in hot_standby (e.g. read only) mode, therefore the minimum version to use
 this action is Postgres 9.0. The I<--warning> and I<--critical> options are the delta between the xlog
 locations. Since these values are byte offsets in the WAL they should match the expected transaction volume
-of your application to prevent false postives or negatives.
+of your application to prevent false positives or negatives.
 
 The first "--dbname", "--host", and "--port", etc. options are considered the
 master; the second belongs to the slave.
@@ -8869,7 +8869,7 @@ =head2 B
 form 'I and I
Version 2.25.0 Released February 3, 2020
-
  Allow same_schema objects to be included or excluded with --object and --skipobject
-    (Greg Sabino Mullane)
+
Allow same_schema objects to be included or excluded with --object and --skipobject
+  (Greg Sabino Mullane)
 
-  Fix to allow mixing service names and other connection parameters for same_schema
-    (Greg Sabino Mullane)
+Fix to allow mixing service names and other connection parameters for same_schema + (Greg Sabino Mullane)
Version 2.24.0 Released May 30, 2018
-
  Support new_version_pg for PG10
-    (Michael Pirogov)
+
Support new_version_pg for PG10
+  (Michael Pirogov)
 
-  Option to skip CYCLE sequences in action sequence
-    (Christoph Moench-Tegeder)
+Option to skip CYCLE sequences in action sequence
+  (Christoph Moench-Tegeder)
 
-  Output per-database perfdata for pgbouncer pool checks
-    (George Hansper)
+Output per-database perfdata for pgbouncer pool checks
+  (George Hansper)
 
-  German message translations
-    (Holger Jacobs)
+German message translations
+  (Holger Jacobs)
 
-  Consider only client backends in query_time and friends
-    (David Christensen)
+Consider only client backends in query_time and friends + (David Christensen)
Version 2.23.0 Released October 31, 2017
-
  Support PostgreSQL 10.
-    (David Christensen, Christoph Berg)
+
Support PostgreSQL 10.
+  (David Christensen, Christoph Berg)
 
-  Change table_size to use pg_table_size() on 9.0+, i.e. include the TOAST
-  table size in the numbers reported. Add new actions indexes_size and
-  total_relation_size, using the respective pg_indexes_size() and
-  pg_total_relation_size() functions. All size checks will now also check
-  materialized views where applicable.
-    (Christoph Berg)
+Change table_size to use pg_table_size() on 9.0+, i.e. include the TOAST
+table size in the numbers reported. Add new actions indexes_size and
+total_relation_size, using the respective pg_indexes_size() and
+pg_total_relation_size() functions. All size checks will now also check
+materialized views where applicable.
+  (Christoph Berg)
 
-  Connection errors are now always critical, not unknown.
-    (Christoph Berg)
+Connection errors are now always critical, not unknown.
+  (Christoph Berg)
 
-  New action replication_slots checking if logical or physical replication
-  slots have accumulated too much data
-    (Glyn Astill)
+New action replication_slots checking if logical or physical replication
+slots have accumulated too much data
+  (Glyn Astill)
 
-  Multiple same_schema improvements
-    (Glyn Astill)
+Multiple same_schema improvements
+  (Glyn Astill)
 
-  Add Spanish message translations
-    (Luis Vazquez)
+Add Spanish message translations
+  (Luis Vazquez)
 
-  Allow a wrapper function to run wal_files and archive_ready actions as
-  non-superuser
-    (Joshua Elsasser)
+Allow a wrapper function to run wal_files and archive_ready actions as
+non-superuser
+  (Joshua Elsasser)
 
-  Add some defensive casting to the bloat query
-    (Greg Sabino Mullane)
+Add some defensive casting to the bloat query
+  (Greg Sabino Mullane)
 
-  Invoke psql with option -X
-    (Peter Eisentraut)
+Invoke psql with option -X
+  (Peter Eisentraut)
 
-  Update postgresql.org URLs to use https.
-    (Magnus Hagander)
+Update postgresql.org URLs to use https.
+  (Magnus Hagander)
 
-  check_txn_idle: Don't fail when query contains 'disabled' word
-    (Marco Nenciarini)
+check_txn_idle: Don't fail when query contains 'disabled' word
+  (Marco Nenciarini)
 
-  check_txn_idle: Use state_change instead of query_start.
-    (Sebastian Webber)
+check_txn_idle: Use state_change instead of query_start.
+  (Sebastian Webber)
 
-  check_hot_standby_delay: Correct extra space in perfdata
-    (Adrien Nayrat)
+check_hot_standby_delay: Correct extra space in perfdata
+  (Adrien Nayrat)
 
-  Remove \r from psql output as it can confuse some regexes
-    (Greg Sabino Mullane)
+Remove \r from psql output as it can confuse some regexes
+  (Greg Sabino Mullane)
 
-  Sort failed jobs in check_pgagent_jobs for stable output.
-    (Christoph Berg)
+Sort failed jobs in check_pgagent_jobs for stable output. + (Christoph Berg)
Version 2.22.0 June 30, 2015
-
  Add xact timestamp support to hot_standby_delay.
-  Allow the hot_standby_delay check to accept xlog byte position or
-  timestamp lag intervals as thresholds, or even both at the same time.
-    (Josh Williams)
+
Add xact timestamp support to hot_standby_delay.
+Allow the hot_standby_delay check to accept xlog byte position or
+timestamp lag intervals as thresholds, or even both at the same time.
+  (Josh Williams)
 
-  Query all sequences per DB in parallel for action=sequence.
-    (Christoph Berg)
+Query all sequences per DB in parallel for action=sequence.
+  (Christoph Berg)
 
-  Fix bloat check to use correct SQL depending on the server version.
-    (Adrian Vondendriesch)
+Fix bloat check to use correct SQL depending on the server version.
+  (Adrian Vondendriesch)
 
-  Show actual long-running query in query_time output
-    (Peter Eisentraut)
+Show actual long-running query in query_time output
+  (Peter Eisentraut)
 
-  Add explicit ORDER BY to the slony_status check to get the most lagged server.
-    (Jeff Frost)
+Add explicit ORDER BY to the slony_status check to get the most lagged server.
+  (Jeff Frost)
 
-  Improved multi-slave support in replicate_row.
-    (Andrew Yochum)
+Improved multi-slave support in replicate_row.
+  (Andrew Yochum)
 
-  Change the way tables are quoted in replicate_row.
-    (Glyn Astill)
+Change the way tables are quoted in replicate_row.
+  (Glyn Astill)
 
-  Don't swallow space before the -c flag when reporting errors
-    (Jeff Janes)
+Don't swallow space before the -c flag when reporting errors
+  (Jeff Janes)
 
-  Fix and extend hot_standby_delay documentation
-    (Michael Renner)
+Fix and extend hot_standby_delay documentation
+  (Michael Renner)
 
-  Declare POD encoding to be utf8.
-    (Christoph Berg)
+Declare POD encoding to be utf8. + (Christoph Berg)
Version 2.21.0 September 24, 2013
-
  Fix issue with SQL steps in check_pgagent_jobs for sql steps which perform deletes
-    (Rob Emery via github pull)
+
Fix issue with SQL steps in check_pgagent_jobs for sql steps which perform deletes
+  (Rob Emery via github pull)
 
-  Install man page in section 1.
-    (Peter Eisentraut, bug 53, github issue 26)
+Install man page in section 1.
+  (Peter Eisentraut, bug 53, github issue 26)
 
-  Order lock types in check_locks output to make the ordering predictable;
-  setting SKIP_NETWORK_TESTS will skip the new_version tests; other minor test
-  suite fixes.
-    (Christoph Berg)
+Order lock types in check_locks output to make the ordering predictable;
+setting SKIP_NETWORK_TESTS will skip the new_version tests; other minor test
+suite fixes.
+  (Christoph Berg)
 
-  Fix same_schema check on 9.3 by ignoring relminmxid differences in pg_class
-    (Christoph Berg)
+Fix same_schema check on 9.3 by ignoring relminmxid differences in pg_class + (Christoph Berg)
Version 2.20.1 June 24, 2013
-
  Make connection check failures return CRITICAL not UNKNOWN
-    (Dominic Hargreaves)
+
Make connection check failures return CRITICAL not UNKNOWN
+  (Dominic Hargreaves)
 
-  Fix --reverse option when using string comparisons in custom queries
-    (Nathaniel Waisbrot)
+Fix --reverse option when using string comparisons in custom queries
+  (Nathaniel Waisbrot)
 
-  Compute correct 'totalwastedbytes' in the bloat query
-    (Michael Renner)
+Compute correct 'totalwastedbytes' in the bloat query
+  (Michael Renner)
 
-  Do not use pg_stats "inherited" column in bloat query, if the
-    database is 8.4 or older. (Greg Sabino Mullane, per bug 121)
+Do not use pg_stats "inherited" column in bloat query, if the
+  database is 8.4 or older. (Greg Sabino Mullane, per bug 121)
 
-  Remove host reordering in hot_standby_delay check
-    (Josh Williams, with help from Jacobo Blasco)
+Remove host reordering in hot_standby_delay check
+  (Josh Williams, with help from Jacobo Blasco)
 
-  Better output for the "simple" flag
-    (Greg Sabino Mullane)
+Better output for the "simple" flag
+  (Greg Sabino Mullane)
 
-  Force same_schema to ignore the 'relallvisible' column
-    (Greg Sabino Mullane)
+Force same_schema to ignore the 'relallvisible' column + (Greg Sabino Mullane)
Version 2.20.0 March 13, 2013
-
  Add check for pgagent jobs (David E. Wheeler)
+
Add check for pgagent jobs (David E. Wheeler)
 
-  Force STDOUT to use utf8 for proper output
-    (Greg Sabino Mullane; reported by Emmanuel Lesouef)
+Force STDOUT to use utf8 for proper output
+  (Greg Sabino Mullane; reported by Emmanuel Lesouef)
 
-  Fixes for Postgres 9.2: new pg_stat_activity view,
-    and use pg_tablespace_location, (Josh Williams)
+Fixes for Postgres 9.2: new pg_stat_activity view,
+  and use pg_tablespace_location, (Josh Williams)
 
-  Allow for spaces in item lists when doing same_schema.
+Allow for spaces in item lists when doing same_schema.
 
-  Allow txn_idle to work again for < 8.3 servers by switching to query_time.
+Allow txn_idle to work again for < 8.3 servers by switching to query_time.
 
-  Fix the check_bloat SQL to take inherited tables into account,
-    and assume 2k for non-analyzed columns. (Geert Pante)
+Fix the check_bloat SQL to take inherited tables into account,
+  and assume 2k for non-analyzed columns. (Geert Pante)
 
-  Cache sequence information to speed up same_schema runs.
+Cache sequence information to speed up same_schema runs.
 
-  Fix --excludeuser in check_txn_idle (Mika Eloranta)
+Fix --excludeuser in check_txn_idle (Mika Eloranta)
 
-  Fix user clause handling in check_txn_idle (Michael van Bracht)
+Fix user clause handling in check_txn_idle (Michael van Bracht)
 
-  Adjust docs to show colon as a better separator inside args for locks
-    (Charles Sprickman)
+Adjust docs to show colon as a better separator inside args for locks
+  (Charles Sprickman)
 
-  Fix undefined $SQL2 error in check_txn_idle [github issue 16] (Patric Bechtel)
+Fix undefined $SQL2 error in check_txn_idle [github issue 16] (Patric Bechtel)
 
-  Prevent "uninitialized value" warnings when showing the port (Henrik Ahlgren)
+Prevent "uninitialized value" warnings when showing the port (Henrik Ahlgren)
 
-  Do not assume everyone has a HOME [github issue 23]
+Do not assume everyone has a HOME [github issue 23]
Version 2.19.0 January 17, 2012
-
  Add the --assume-prod option (Cédric Villemain)
+
Add the --assume-prod option (Cédric Villemain)
 
-  Add the cluster_id check (Cédric Villemain)
+Add the cluster_id check (Cédric Villemain)
 
-  Improve settings_checksum and checkpoint tests (Cédric Villemain)
+Improve settings_checksum and checkpoint tests (Cédric Villemain)
 
-  Do not do an inner join to pg_user when checking database size
-    (Greg Sabino Mullane; reported by Emmanuel Lesouef)
+Do not do an inner join to pg_user when checking database size
+  (Greg Sabino Mullane; reported by Emmanuel Lesouef)
 
-  Use the full path when getting sequence information for same_schema.
-    (Greg Sabino Mullane; reported by Cindy Wise)
+Use the full path when getting sequence information for same_schema.
+  (Greg Sabino Mullane; reported by Cindy Wise)
 
-  Fix the formula for calculating xlog positions (Euler Taveira de Oliveira)
+Fix the formula for calculating xlog positions (Euler Taveira de Oliveira)
 
-  Better ordering of output for bloat check - make indexes as important
-    as tables (Greg Sabino Mullane; reported by Jens Wilke)
+Better ordering of output for bloat check - make indexes as important
+  as tables (Greg Sabino Mullane; reported by Jens Wilke)
 
-  Show the dbservice if it was used at top of same_schema output
-    (Mike Blackwell)
+Show the dbservice if it was used at top of same_schema output
+  (Mike Blackwell)
 
-  Better installation paths (Greg Sabino Mullane, per bug 53)
+Better installation paths (Greg Sabino Mullane, per bug 53)
Version 2.18.0 October 2, 2011
-
  Redo the same_schema action. Use new --filter argument for all filtering.
-  Allow comparisons between any number of databases.
-  Remove the dbname2, dbport2, etc. arguments.
-  Allow comparison of the same db over time.
+
Redo the same_schema action. Use new --filter argument for all filtering.
+Allow comparisons between any number of databases.
+Remove the dbname2, dbport2, etc. arguments.
+Allow comparison of the same db over time.
 
-  Swap db1 and db2 if the slave is 1 for the hot standby check (David E. Wheeler)
+Swap db1 and db2 if the slave is 1 for the hot standby check (David E. Wheeler)
 
-  Allow multiple --schema arguments for the slony_status action (GSM and Jehan-Guillaume de Rorthais)
+Allow multiple --schema arguments for the slony_status action (GSM and Jehan-Guillaume de Rorthais)
 
-  Fix ORDER BY in the last vacuum/analyze action (Nicolas Thauvin)
+Fix ORDER BY in the last vacuum/analyze action (Nicolas Thauvin)
 
-  Fix check_hot_standby_delay perfdata output (Nicolas Thauvin)
+Fix check_hot_standby_delay perfdata output (Nicolas Thauvin)
 
-  Look in the correct place for the .ready files with the archive_ready action (Nicolas Thauvin)
+Look in the correct place for the .ready files with the archive_ready action (Nicolas Thauvin)
 
-  New action: commitratio (Guillaume Lelarge)
+New action: commitratio (Guillaume Lelarge)
 
-  New action: hitratio (Guillaume Lelarge)
+New action: hitratio (Guillaume Lelarge)
 
-  Make sure --action overrides the symlink naming trick.
+Make sure --action overrides the symlink naming trick.
 
-  Set defaults for archive_ready and wal_files (Thomas Guettler, GSM)
+Set defaults for archive_ready and wal_files (Thomas Guettler, GSM)
 
-  Better output for wal_files and archive_ready (GSM)
+Better output for wal_files and archive_ready (GSM)
 
-  Fix warning when client_port set to empty string (bug #79)
+Fix warning when client_port set to empty string (bug #79)
 
-  Account for "empty row" in -x output (i.e. source of functions).
+Account for "empty row" in -x output (i.e. source of functions).
 
-  Fix some incorrectly named data fields (Andy Lester)
+Fix some incorrectly named data fields (Andy Lester)
 
-  Expand the number of pgbouncer actions (Ruslan Kabalin)
+Expand the number of pgbouncer actions (Ruslan Kabalin)
 
-  Give detailed information and refactor txn_idle, txn_time, and query_time
-    (Per request from bug #61)
+Give detailed information and refactor txn_idle, txn_time, and query_time
+  (Per request from bug #61)
 
-  Set maxalign to 8 in the bloat check if box identified as '64-bit'
-    (Michel Sijmons, bug #66)
+Set maxalign to 8 in the bloat check if box identified as '64-bit'
+  (Michel Sijmons, bug #66)
 
-  Support non-standard version strings in the bloat check.
-    (Michel Sijmons and Gurjeet Singh, bug #66)
+Support non-standard version strings in the bloat check.
+  (Michel Sijmons and Gurjeet Singh, bug #66)
 
-  Do not show excluded databases in some output (Ruslan Kabalin)
+Do not show excluded databases in some output (Ruslan Kabalin)
 
-  Allow "and", "or" inside arguments (David E. Wheeler)
+Allow "and", "or" inside arguments (David E. Wheeler)
 
-  Add the "new_version_box" action.
+Add the "new_version_box" action.
 
-  Fix psql version regex (Peter Eisentraut, bug #69)
+Fix psql version regex (Peter Eisentraut, bug #69)
 
-  Add the --assume-standby-mode option (Ruslan Kabalin)
+Add the --assume-standby-mode option (Ruslan Kabalin)
 
-  Note that txn_idle and query_time require 8.3 (Thomas Guettler)
+Note that txn_idle and query_time require 8.3 (Thomas Guettler)
 
-  Standardize and clean up all perfdata output (bug #52)
+Standardize and clean up all perfdata output (bug #52)
 
-  Exclude "idle in transaction" from the query_time check (bug #43)
+Exclude "idle in transaction" from the query_time check (bug #43)
 
-  Fix the perflimit for the bloat action (bug #50)
+Fix the perflimit for the bloat action (bug #50)
 
-  Clean up the custom_query action a bit.
+Clean up the custom_query action a bit.
 
-  Fix space in perfdata for hot_standby_delay action (Nicolas Thauvin)
+Fix space in perfdata for hot_standby_delay action (Nicolas Thauvin)
 
-  Handle undef percents in check_fsm_relations (Andy Lester)
+Handle undef percents in check_fsm_relations (Andy Lester)
 
-  Fix typo in dbstats action (Stas Vitkovsky)
+Fix typo in dbstats action (Stas Vitkovsky)
 
-  Fix MRTG for last vacuum and last_analyze actions.
+Fix MRTG for last vacuum and last_analyze actions.
Version 2.17.0 no public release
@@ -1934,688 +1969,688 @@

HISTORY

Version 2.16.0 January 20, 2011
-
  Add new action 'hot_standby_delay' (Nicolas Thauvin)
-  Add cache-busting for the version-grabbing utilities.
-  Fix problem with going to next method for new_version_pg
-    (Greg Sabino Mullane, reported by Hywel Mallett in bug #65)
-  Allow /usr/local/etc as an alternative location for the 
-    check_postgresrc file (Hywel Mallett)
-  Do not use tgisconstraint in same_schema if Postgres >= 9
-    (Guillaume Lelarge)
+
Add new action 'hot_standby_delay' (Nicolas Thauvin)
+Add cache-busting for the version-grabbing utilities.
+Fix problem with going to next method for new_version_pg
+  (Greg Sabino Mullane, reported by Hywel Mallett in bug #65)
+Allow /usr/local/etc as an alternative location for the 
+  check_postgresrc file (Hywel Mallett)
+Do not use tgisconstraint in same_schema if Postgres >= 9
+  (Guillaume Lelarge)
Version 2.15.4 January 3, 2011
-
  Fix warning when using symlinks
-    (Greg Sabino Mullane, reported by Peter Eisentraut in bug #63)
+
Fix warning when using symlinks
+  (Greg Sabino Mullane, reported by Peter Eisentraut in bug #63)
Version 2.15.3 December 30, 2010
-
  Show OK for no matching txn_idle entries.
+
Show OK for no matching txn_idle entries.
Version 2.15.2 December 28, 2010
-
  Better formatting of sizes in the bloat action output.
+
Better formatting of sizes in the bloat action output.
 
-  Remove duplicate perfs in bloat action output.
+Remove duplicate perfs in bloat action output.
Version 2.15.1 December 27, 2010
-
  Fix problem when examining items in pg_settings (Greg Sabino Mullane)
+
Fix problem when examining items in pg_settings (Greg Sabino Mullane)
 
-  For connection test, return critical, not unknown, on FATAL errors
-    (Greg Sabino Mullane, reported by Peter Eisentraut in bug #62)
+For connection test, return critical, not unknown, on FATAL errors + (Greg Sabino Mullane, reported by Peter Eisentraut in bug #62)
Version 2.15.0 November 8, 2010
-
  Add --quiet argument to suppress output on OK Nagios results
-  Add index comparison for same_schema (Norman Yamada and Greg Sabino Mullane)
-  Use $ENV{PGSERVICE} instead of "service=" to prevent problems (Guillaume Lelarge)
-  Add --man option to show the entire manual. (Andy Lester)
-  Redo the internal run_command() sub to use -x and hashes instead of regexes.
-  Fix error in custom logic (Andreas Mager)
-  Add the "pgbouncer_checksum" action (Guillaume Lelarge)
-  Fix regex to work on WIN32 for check_fsm_relations and check_fsm_pages (Luke Koops)
-  Don't apply a LIMIT when using --exclude on the bloat action (Marti Raudsepp)
-  Change the output of query_time to show pid,user,port, and address (Giles Westwood)
-  Fix to show database properly when using slony_status (Guillaume Lelarge)
-  Allow warning items for same_schema to be comma-separated (Guillaume Lelarge)
-  Constraint definitions across Postgres versions match better in same_schema.
-  Work against "EnterpriseDB" databases (Sivakumar Krishnamurthy and Greg Sabino Mullane)
-  Separate perfdata with spaces (Jehan-Guillaume (ioguix) de Rorthais)
-  Add new action "archive_ready" (Jehan-Guillaume (ioguix) de Rorthais)
+
Add --quiet argument to suppress output on OK Nagios results
+Add index comparison for same_schema (Norman Yamada and Greg Sabino Mullane)
+Use $ENV{PGSERVICE} instead of "service=" to prevent problems (Guillaume Lelarge)
+Add --man option to show the entire manual. (Andy Lester)
+Redo the internal run_command() sub to use -x and hashes instead of regexes.
+Fix error in custom logic (Andreas Mager)
+Add the "pgbouncer_checksum" action (Guillaume Lelarge)
+Fix regex to work on WIN32 for check_fsm_relations and check_fsm_pages (Luke Koops)
+Don't apply a LIMIT when using --exclude on the bloat action (Marti Raudsepp)
+Change the output of query_time to show pid,user,port, and address (Giles Westwood)
+Fix to show database properly when using slony_status (Guillaume Lelarge)
+Allow warning items for same_schema to be comma-separated (Guillaume Lelarge)
+Constraint definitions across Postgres versions match better in same_schema.
+Work against "EnterpriseDB" databases (Sivakumar Krishnamurthy and Greg Sabino Mullane)
+Separate perfdata with spaces (Jehan-Guillaume (ioguix) de Rorthais)
+Add new action "archive_ready" (Jehan-Guillaume (ioguix) de Rorthais)
Version 2.14.3 (March 1, 2010)
-
  Allow slony_status action to handle more than one slave.
-  Use commas to separate function args in same_schema output (Robert Treat)
+
Allow slony_status action to handle more than one slave.
+Use commas to separate function args in same_schema output (Robert Treat)
Version 2.14.2 (February 18, 2010)
-
  Change autovac_freeze default warn/critical back to 90%/95% (Robert Treat)
-  Put all items one-per-line for relation size actions if --verbose=1
+
Change autovac_freeze default warn/critical back to 90%/95% (Robert Treat)
+Put all items one-per-line for relation size actions if --verbose=1
Version 2.14.1 (February 17, 2010)
-
  Don't use $^T in logfile check, as script may be long-running
-  Change the error string for the logfile action for easier exclusion
-    by programs like tail_n_mail
+
Don't use $^T in logfile check, as script may be long-running
+Change the error string for the logfile action for easier exclusion
+  by programs like tail_n_mail
Version 2.14.0 (February 11, 2010)
-
  Added the 'slony_status' action.
-  Changed the logfile sleep from 0.5 to 1, as 0.5 gets rounded to 0 on some boxes!
+
Added the 'slony_status' action.
+Changed the logfile sleep from 0.5 to 1, as 0.5 gets rounded to 0 on some boxes!
Version 2.13.2 (February 4, 2010)
-
  Allow timeout option to be used for logtime 'sleep' time.
+
Allow timeout option to be used for logtime 'sleep' time.
Version 2.13.2 (February 4, 2010)
-
  Show offending database for query_time action.
-  Apply perflimit to main output for sequence action.
-  Add 'noowner' option to same_schema action.
-  Raise sleep timeout for logfile check to 15 seconds.
+
Show offending database for query_time action.
+Apply perflimit to main output for sequence action.
+Add 'noowner' option to same_schema action.
+Raise sleep timeout for logfile check to 15 seconds.
Version 2.13.1 (February 2, 2010)
-
  Fix bug preventing column constraint differences from 2 > 1 for same_schema from being shown.
-  Allow aliases 'dbname1', 'dbhost1', 'dbport1',etc.
-  Added "nolanguage" as a filter for the same_schema option.
-  Don't track "generic" table constraints (e.. $1, $2) using same_schema
+
Fix bug preventing column constraint differences from 2 > 1 for same_schema from being shown.
+Allow aliases 'dbname1', 'dbhost1', 'dbport1',etc.
+Added "nolanguage" as a filter for the same_schema option.
+Don't track "generic" table constraints (e.. $1, $2) using same_schema
Version 2.13.0 (January 29, 2010)
-
  Allow "nofunctions" as a filter for the same_schema option.
-  Added "noperm" as a filter for the same_schema option.
-  Ignore dropped columns when considered positions for same_schema (Guillaume Lelarge)
+
Allow "nofunctions" as a filter for the same_schema option.
+Added "noperm" as a filter for the same_schema option.
+Ignore dropped columns when considered positions for same_schema (Guillaume Lelarge)
Version 2.12.1 (December 3, 2009)
-
  Change autovac_freeze default warn/critical from 90%/95% to 105%/120% (Marti Raudsepp)
+
Change autovac_freeze default warn/critical from 90%/95% to 105%/120% (Marti Raudsepp)
Version 2.12.0 (December 3, 2009)
-
  Allow the temporary directory to be specified via the "tempdir" argument,
-    for systems that need it (e.g. /tmp is not owned by root).
-  Fix so old versions of Postgres (< 8.0) use the correct default database (Giles Westwood)
-  For "same_schema" trigger mismatches, show the attached table.
-  Add the new_version_bc check for Bucardo version checking.
-  Add database name to perf output for last_vacuum|analyze (Guillaume Lelarge)
-  Fix for bloat action against old versions of Postgres without the 'block_size' param.
+
Allow the temporary directory to be specified via the "tempdir" argument,
+  for systems that need it (e.g. /tmp is not owned by root).
+Fix so old versions of Postgres (< 8.0) use the correct default database (Giles Westwood)
+For "same_schema" trigger mismatches, show the attached table.
+Add the new_version_bc check for Bucardo version checking.
+Add database name to perf output for last_vacuum|analyze (Guillaume Lelarge)
+Fix for bloat action against old versions of Postgres without the 'block_size' param.
Version 2.11.1 (August 27, 2009)
-
  Proper Nagios output for last_vacuum|analyze actions. (Cédric Villemain)
-  Proper Nagios output for locks action. (Cédric Villemain)
-  Proper Nagios output for txn_wraparound action. (Cédric Villemain)
-  Fix for constraints with embedded newlines for same_schema.
-  Allow --exclude for all items when using same_schema.
+
Proper Nagios output for last_vacuum|analyze actions. (Cédric Villemain)
+Proper Nagios output for locks action. (Cédric Villemain)
+Proper Nagios output for txn_wraparound action. (Cédric Villemain)
+Fix for constraints with embedded newlines for same_schema.
+Allow --exclude for all items when using same_schema.
Version 2.11.0 (August 23, 2009)
-
  Add Nagios perf output to the wal_files check (Cédric Villemain)
-  Add support for .check_postgresrc, per request from Albe Laurenz.
-  Allow list of web fetch methods to be changed with the --get_method option.
-  Add support for the --language argument, which overrides any ENV.
-  Add the --no-check_postgresrc flag.
-  Ensure check_postgresrc options are completely overridden by command-line options.
-  Fix incorrect warning > critical logic in replicate_rows (Glyn Astill)
+
Add Nagios perf output to the wal_files check (Cédric Villemain)
+Add support for .check_postgresrc, per request from Albe Laurenz.
+Allow list of web fetch methods to be changed with the --get_method option.
+Add support for the --language argument, which overrides any ENV.
+Add the --no-check_postgresrc flag.
+Ensure check_postgresrc options are completely overridden by command-line options.
+Fix incorrect warning > critical logic in replicate_rows (Glyn Astill)
Version 2.10.0 (August 3, 2009)
-
  For same_schema, compare view definitions, and compare languages.
-  Make script into a global executable via the Makefile.PL file.
-  Better output when comparing two databases.
-  Proper Nagios output syntax for autovac_freeze and backends checks (Cédric Villemain)
+
For same_schema, compare view definitions, and compare languages.
+Make script into a global executable via the Makefile.PL file.
+Better output when comparing two databases.
+Proper Nagios output syntax for autovac_freeze and backends checks (Cédric Villemain)
Version 2.9.5 (July 24, 2009)
-
  Don't use a LIMIT in check_bloat if --include is used. Per complaint from Jeff Frost.
+
Don't use a LIMIT in check_bloat if --include is used. Per complaint from Jeff Frost.
Version 2.9.4 (July 21, 2009)
-
  More French translations (Guillaume Lelarge)
+
More French translations (Guillaume Lelarge)
Version 2.9.3 (July 14, 2009)
-
  Quote dbname in perf output for the backends check. (Davide Abrigo)
-  Add 'fetch' as an alternative method for new_version checks, as this 
-    comes by default with FreeBSD. (Hywel Mallett)
+
Quote dbname in perf output for the backends check. (Davide Abrigo)
+Add 'fetch' as an alternative method for new_version checks, as this 
+  comes by default with FreeBSD. (Hywel Mallett)
Version 2.9.2 (July 12, 2009)
-
  Allow dots and dashes in database name for the backends check (Davide Abrigo)
-  Check and display the database for each match in the bloat check (Cédric Villemain)
-  Handle 'too many connections' FATAL error in the backends check with a critical,
-    rather than a generic error (Greg, idea by Jürgen Schulz-Brüssel)
-  Do not allow perflimit to interfere with exclusion rules in the vacuum and 
-    analyze tests. (Greg, bug reported by Jeff Frost)
+
Allow dots and dashes in database name for the backends check (Davide Abrigo)
+Check and display the database for each match in the bloat check (Cédric Villemain)
+Handle 'too many connections' FATAL error in the backends check with a critical,
+  rather than a generic error (Greg, idea by Jürgen Schulz-Brüssel)
+Do not allow perflimit to interfere with exclusion rules in the vacuum and 
+  analyze tests. (Greg, bug reported by Jeff Frost)
Version 2.9.1 (June 12, 2009)
-
  Fix for multiple databases with the check_bloat action (Mark Kirkwood)
-  Fixes and improvements to the same_schema action (Jeff Boes)
-  Write tests for same_schema, other minor test fixes (Jeff Boes)
+
Fix for multiple databases with the check_bloat action (Mark Kirkwood)
+Fixes and improvements to the same_schema action (Jeff Boes)
+Write tests for same_schema, other minor test fixes (Jeff Boes)
Version 2.9.0 (May 28, 2009)
-
  Added the same_schema action (Greg)
+
Added the same_schema action (Greg)
Version 2.8.1 (May 15, 2009)
-
  Added timeout via statement_timeout in addition to perl alarm (Greg)
+
Added timeout via statement_timeout in addition to perl alarm (Greg)
Version 2.8.0 (May 4, 2009)
-
  Added internationalization support (Greg)
-  Added the 'disabled_triggers' check (Greg)
-  Added the 'prepared_txns' check (Greg)
-  Added the 'new_version_cp' and 'new_version_pg' checks (Greg)
-  French translations (Guillaume Lelarge)
-  Make the backends search return ok if no matches due to inclusion rules,
-    per report by Guillaume Lelarge (Greg)
-  Added comprehensive unit tests (Greg, Jeff Boes, Selena Deckelmann)
-  Make fsm_pages and fsm_relations handle 8.4 servers smoothly. (Greg)
-  Fix missing 'upd' field in show_dbstats (Andras Fabian)
-  Allow ENV{PGCONTROLDATA} and ENV{PGBINDIR}. (Greg)
-  Add various Perl module infrastructure (e.g. Makefile.PL) (Greg)
-  Fix incorrect regex in txn_wraparound (Greg)
-  For txn_wraparound: consistent ordering and fix duplicates in perf output (Andras Fabian)
-  Add in missing exabyte regex check (Selena Deckelmann)
-  Set stats to zero if we bail early due to USERWHERECLAUSE (Andras Fabian)
-  Add additional items to dbstats output (Andras Fabian)
-  Remove --schema option from the fsm_ checks. (Greg Mullane and Robert Treat)
-  Handle case when ENV{PGUSER} is set. (Andy Lester)
-  Many various fixes. (Jeff Boes)
-  Fix --dbservice: check version and use ENV{PGSERVICE} for old versions (Cédric Villemain)
+
Added internationalization support (Greg)
+Added the 'disabled_triggers' check (Greg)
+Added the 'prepared_txns' check (Greg)
+Added the 'new_version_cp' and 'new_version_pg' checks (Greg)
+French translations (Guillaume Lelarge)
+Make the backends search return ok if no matches due to inclusion rules,
+  per report by Guillaume Lelarge (Greg)
+Added comprehensive unit tests (Greg, Jeff Boes, Selena Deckelmann)
+Make fsm_pages and fsm_relations handle 8.4 servers smoothly. (Greg)
+Fix missing 'upd' field in show_dbstats (Andras Fabian)
+Allow ENV{PGCONTROLDATA} and ENV{PGBINDIR}. (Greg)
+Add various Perl module infrastructure (e.g. Makefile.PL) (Greg)
+Fix incorrect regex in txn_wraparound (Greg)
+For txn_wraparound: consistent ordering and fix duplicates in perf output (Andras Fabian)
+Add in missing exabyte regex check (Selena Deckelmann)
+Set stats to zero if we bail early due to USERWHERECLAUSE (Andras Fabian)
+Add additional items to dbstats output (Andras Fabian)
+Remove --schema option from the fsm_ checks. (Greg Mullane and Robert Treat)
+Handle case when ENV{PGUSER} is set. (Andy Lester)
+Many various fixes. (Jeff Boes)
+Fix --dbservice: check version and use ENV{PGSERVICE} for old versions (Cédric Villemain)
Version 2.7.3 (February 10, 2009)
-
  Make the sequence action check if sequence being used for a int4 column and
-  react appropriately. (Michael Glaesemann)
+
Make the sequence action check if sequence being used for a int4 column and
+react appropriately. (Michael Glaesemann)
Version 2.7.2 (February 9, 2009)
-
  Fix to prevent multiple groupings if db arguments given.
+
Fix to prevent multiple groupings if db arguments given.
Version 2.7.1 (February 6, 2009)
-
  Allow the -p argument for port to work again.
+
Allow the -p argument for port to work again.
Version 2.7.0 (February 4, 2009)
-
  Do not require a connection argument, but use defaults and ENV variables when 
-    possible: PGHOST, PGPORT, PGUSER, PGDATABASE.
+
Do not require a connection argument, but use defaults and ENV variables when 
+  possible: PGHOST, PGPORT, PGUSER, PGDATABASE.
Version 2.6.1 (February 4, 2009)
-
  Only require Date::Parse to be loaded if using the checkpoint action.
+
Only require Date::Parse to be loaded if using the checkpoint action.
Version 2.6.0 (January 26, 2009)
-
  Add the 'checkpoint' action.
+
Add the 'checkpoint' action.
Version 2.5.4 (January 7, 2009)
-
  Better checking of $opt{dbservice} structure (Cédric Villemain)
-  Fix time display in timesync action output (Selena Deckelmann)
-  Fix documentation typos (Josh Tolley)
+
Better checking of $opt{dbservice} structure (Cédric Villemain)
+Fix time display in timesync action output (Selena Deckelmann)
+Fix documentation typos (Josh Tolley)
Version 2.5.3 (December 17, 2008)
-
  Minor fix to regex in verify_version (Lee Jensen)
+
Minor fix to regex in verify_version (Lee Jensen)
Version 2.5.2 (December 16, 2008)
-
  Minor documentation tweak.
+
Minor documentation tweak.
Version 2.5.1 (December 11, 2008)
-
  Add support for --noidle flag to prevent backends action from counting idle processes.
-  Patch by Selena Deckelmann.
+
Add support for --noidle flag to prevent backends action from counting idle processes.
+Patch by Selena Deckelmann.
 
-  Fix small undefined warning when not using --dbservice.
+Fix small undefined warning when not using --dbservice.
Version 2.5.0 (December 4, 2008)
-
  Add support for the pg_Service.conf file with the --dbservice option.
+
Add support for the pg_Service.conf file with the --dbservice option.
Version 2.4.3 (November 7, 2008)
-
  Fix options for replicate_row action, per report from Jason Gordon.
+
Fix options for replicate_row action, per report from Jason Gordon.
Version 2.4.2 (November 6, 2008)
-
  Wrap File::Temp::cleanup() calls in eval, in case File::Temp is an older version.
-  Patch by Chris Butler.
+
Wrap File::Temp::cleanup() calls in eval, in case File::Temp is an older version.
+Patch by Chris Butler.
Version 2.4.1 (November 5, 2008)
-
  Cast numbers to numeric to support sequences ranges > bigint in check_sequence action.
-  Thanks to Scott Marlowe for reporting this.
+
Cast numbers to numeric to support sequences ranges > bigint in check_sequence action.
+Thanks to Scott Marlowe for reporting this.
Version 2.4.0 (October 26, 2008)
-
 Add Cacti support with the dbstats action.
- Pretty up the time output for last vacuum and analyze actions.
- Show the percentage of backends on the check_backends action.
+
Add Cacti support with the dbstats action.
+Pretty up the time output for last vacuum and analyze actions.
+Show the percentage of backends on the check_backends action.
Version 2.3.10 (October 23, 2008)
-
 Fix minor warning in action check_bloat with multiple databases.
- Allow warning to be greater than critical when using the --reverse option.
- Support the --perflimit option for the check_sequence action.
+
Fix minor warning in action check_bloat with multiple databases.
+Allow warning to be greater than critical when using the --reverse option.
+Support the --perflimit option for the check_sequence action.
Version 2.3.9 (October 23, 2008)
-
 Minor tweak to way we store the default port.
+
Minor tweak to way we store the default port.
Version 2.3.8 (October 21, 2008)
-
 Allow the default port to be changed easily.
- Allow transform of simple output by MB, GB, etc.
+
Allow the default port to be changed easily.
+Allow transform of simple output by MB, GB, etc.
Version 2.3.7 (October 14, 2008)
-
 Allow multiple databases in 'sequence' action. Reported by Christoph Zwerschke.
+
Allow multiple databases in 'sequence' action. Reported by Christoph Zwerschke.
Version 2.3.6 (October 13, 2008)
-
 Add missing $schema to check_fsm_pages. (Robert Treat)
+
Add missing $schema to check_fsm_pages. (Robert Treat)
Version 2.3.5 (October 9, 2008)
-
 Change option 'checktype' to 'valtype' to prevent collisions with -c[ritical]
- Better handling of errors.
+
Change option 'checktype' to 'valtype' to prevent collisions with -c[ritical]
+Better handling of errors.
Version 2.3.4 (October 9, 2008)
-
 Do explicit cleanups of the temp directory, per problems reported by sb@nnx.com.
+
Do explicit cleanups of the temp directory, per problems reported by sb@nnx.com.
Version 2.3.3 (October 8, 2008)
-
 Account for cases where some rounding queries give -0 instead of 0.
- Thanks to Glyn Astill for helping to track this down.
+
Account for cases where some rounding queries give -0 instead of 0.
+Thanks to Glyn Astill for helping to track this down.
Version 2.3.2 (October 8, 2008)
-
 Always quote identifiers in check_replicate_row action.
+
Always quote identifiers in check_replicate_row action.
Version 2.3.1 (October 7, 2008)
-
 Give a better error if one of the databases cannot be reached.
+
Give a better error if one of the databases cannot be reached.
Version 2.3.0 (October 4, 2008)
-
 Add the "sequence" action, thanks to Gavin M. Roy for the idea.
- Fix minor problem with autovac_freeze action when using MRTG output.
- Allow output argument to be case-insensitive.
- Documentation fixes.
+
Add the "sequence" action, thanks to Gavin M. Roy for the idea.
+Fix minor problem with autovac_freeze action when using MRTG output.
+Allow output argument to be case-insensitive.
+Documentation fixes.
Version 2.2.4 (October 3, 2008)
-
 Fix some minor typos
+
Fix some minor typos
Version 2.2.3 (October 1, 2008)
-
 Expand range of allowed names for --repinfo argument (Glyn Astill)
- Documentation tweaks.
+
Expand range of allowed names for --repinfo argument (Glyn Astill)
+Documentation tweaks.
Version 2.2.2 (September 30, 2008)
-
 Fixes for minor output and scoping problems.
+
Fixes for minor output and scoping problems.
Version 2.2.1 (September 28, 2008)
-
 Add MRTG output to fsm_pages and fsm_relations.
- Force error messages to one-line for proper Nagios output.
- Check for invalid prereqs on failed command. From conversations with Euler Taveira de Oliveira.
- Tweak the fsm_pages formula a little.
+
Add MRTG output to fsm_pages and fsm_relations.
+Force error messages to one-line for proper Nagios output.
+Check for invalid prereqs on failed command. From conversations with Euler Taveira de Oliveira.
+Tweak the fsm_pages formula a little.
Version 2.2.0 (September 25, 2008)
-
 Add fsm_pages and fsm_relations actions. (Robert Treat)
+
Add fsm_pages and fsm_relations actions. (Robert Treat)
Version 2.1.4 (September 22, 2008)
-
 Fix for race condition in txn_time action.
- Add --debugoutput option.
+
Fix for race condition in txn_time action.
+Add --debugoutput option.
Version 2.1.3 (September 22, 2008)
-
 Allow alternate arguments "dbhost" for "host" and "dbport" for "port".
- Output a zero as default value for second line of MRTG output.
+
Allow alternate arguments "dbhost" for "host" and "dbport" for "port".
+Output a zero as default value for second line of MRTG output.
Version 2.1.2 (July 28, 2008)
-
 Fix sorting error in the "disk_space" action for non-Nagios output.
- Allow --simple as a shortcut for --output=simple.
+
Fix sorting error in the "disk_space" action for non-Nagios output.
+Allow --simple as a shortcut for --output=simple.
Version 2.1.1 (July 22, 2008)
-
 Don't check databases with datallowconn false for the "autovac_freeze" action.
+
Don't check databases with datallowconn false for the "autovac_freeze" action.
Version 2.1.0 (July 18, 2008)
-
 Add the "autovac_freeze" action, thanks to Robert Treat for the idea and design.
- Put an ORDER BY on the "txn_wraparound" action.
+
Add the "autovac_freeze" action, thanks to Robert Treat for the idea and design.
+Put an ORDER BY on the "txn_wraparound" action.
Version 2.0.1 (July 16, 2008)
-
 Optimizations to speed up the "bloat" action quite a bit.
- Fix "version" action to not always output in mrtg mode.
+
Optimizations to speed up the "bloat" action quite a bit.
+Fix "version" action to not always output in mrtg mode.
Version 2.0.0 (July 15, 2008)
-
 Add support for MRTG and "simple" output options.
- Many small improvements to nearly all actions.
+
Add support for MRTG and "simple" output options.
+Many small improvements to nearly all actions.
Version 1.9.1 (June 24, 2008)
-
 Fix an error in the bloat SQL in 1.9.0
- Allow percentage arguments to be over 99%
- Allow percentages in the bloat --warning and --critical (thanks to Robert Treat for the idea)
+
Fix an error in the bloat SQL in 1.9.0
+Allow percentage arguments to be over 99%
+Allow percentages in the bloat --warning and --critical (thanks to Robert Treat for the idea)
Version 1.9.0 (June 22, 2008)
-
 Don't include information_schema in certain checks. (Jeff Frost)
- Allow --include and --exclude to use schemas by using a trailing period.
+
Don't include information_schema in certain checks. (Jeff Frost)
+Allow --include and --exclude to use schemas by using a trailing period.
Version 1.8.5 (June 22, 2008)
-
 Output schema name before table name where appropriate.
- Thanks to Jeff Frost.
+
Output schema name before table name where appropriate.
+Thanks to Jeff Frost.
Version 1.8.4 (June 19, 2008)
-
 Better detection of problems in --replicate_row.
+
Better detection of problems in --replicate_row.
Version 1.8.3 (June 18, 2008)
-
 Fix 'backends' action: there may be no rows in pg_stat_activity, so run a second
-   query if needed to find the max_connections setting.
- Thanks to Jeff Frost for the bug report.
+
Fix 'backends' action: there may be no rows in pg_stat_activity, so run a second
+  query if needed to find the max_connections setting.
+Thanks to Jeff Frost for the bug report.
Version 1.8.2 (June 10, 2008)
-
 Changes to allow working under Nagios' embedded Perl mode. (Ioannis Tambouras)
+
Changes to allow working under Nagios' embedded Perl mode. (Ioannis Tambouras)
Version 1.8.1 (June 9, 2008)
-
 Allow 'bloat' action to work on Postgres version 8.0.
- Allow for different commands to be run for each action depending on the server version.
- Give better warnings when running actions not available on older Postgres servers.
+
Allow 'bloat' action to work on Postgres version 8.0.
+Allow for different commands to be run for each action depending on the server version.
+Give better warnings when running actions not available on older Postgres servers.
Version 1.8.0 (June 3, 2008)
-
 Add the --reverse option to the custom_query action.
+
Add the --reverse option to the custom_query action.
Version 1.7.1 (June 2, 2008)
-
 Fix 'query_time' action: account for race condition in which zero rows appear in pg_stat_activity.
- Thanks to Dustin Black for the bug report.
+
Fix 'query_time' action: account for race condition in which zero rows appear in pg_stat_activity.
+Thanks to Dustin Black for the bug report.
Version 1.7.0 (May 11, 2008)
-
 Add --replicate_row action
+
Add --replicate_row action
Version 1.6.1 (May 11, 2008)
-
 Add --symlinks option as a shortcut to --action=rebuild_symlinks
+
Add --symlinks option as a shortcut to --action=rebuild_symlinks
Version 1.6.0 (May 11, 2008)
-
 Add the custom_query action.
+
Add the custom_query action.
Version 1.5.2 (May 2, 2008)
-
 Fix problem with too eager creation of custom pgpass file.
+
Fix problem with too eager creation of custom pgpass file.
Version 1.5.1 (April 17, 2008)
-
 Add example Nagios configuration settings (Brian A. Seklecki)
+
Add example Nagios configuration settings (Brian A. Seklecki)
Version 1.5.0 (April 16, 2008)
-
 Add the --includeuser and --excludeuser options. Documentation cleanup.
+
Add the --includeuser and --excludeuser options. Documentation cleanup.
Version 1.4.3 (April 16, 2008)
-
 Add in the 'output' concept for future support of non-Nagios programs.
+
Add in the 'output' concept for future support of non-Nagios programs.
Version 1.4.2 (April 8, 2008)
-
 Fix bug preventing --dbpass argument from working (Robert Treat).
+
Fix bug preventing --dbpass argument from working (Robert Treat).
Version 1.4.1 (April 4, 2008)
-
 Minor documentation fixes.
+
Minor documentation fixes.
Version 1.4.0 (April 2, 2008)
-
 Have 'wal_files' action use pg_ls_dir (idea by Robert Treat).
- For last_vacuum and last_analyze, respect autovacuum effects, add separate 
-   autovacuum checks (ideas by Robert Treat).
+
Have 'wal_files' action use pg_ls_dir (idea by Robert Treat).
+For last_vacuum and last_analyze, respect autovacuum effects, add separate 
+  autovacuum checks (ideas by Robert Treat).
Version 1.3.1 (April 2, 2008)
-
 Have txn_idle use query_start, not xact_start.
+
Have txn_idle use query_start, not xact_start.
Version 1.3.0 (March 23, 2008)
-
 Add in txn_idle and txn_time actions.
+
Add in txn_idle and txn_time actions.
Version 1.2.0 (February 21, 2008)
-
 Add the 'wal_files' action, which counts the number of WAL files
-   in your pg_xlog directory.
- Fix some typos in the docs.
- Explicitly allow -v as an argument.
- Allow for a null syslog_facility in the 'logfile' action.
+
Add the 'wal_files' action, which counts the number of WAL files
+  in your pg_xlog directory.
+Fix some typos in the docs.
+Explicitly allow -v as an argument.
+Allow for a null syslog_facility in the 'logfile' action.
Version 1.1.2 (February 5, 2008)
-
 Fix error preventing --action=rebuild_symlinks from working.
+
Fix error preventing --action=rebuild_symlinks from working.
Version 1.1.1 (February 3, 2008)
-
 Switch vacuum and analyze date output to use 'DD', not 'D'. (Glyn Astill)
+
Switch vacuum and analyze date output to use 'DD', not 'D'. (Glyn Astill)
Version 1.1.0 (December 16, 2008)
-
 Fixes, enhancements, and performance tracking.
- Add performance data tracking via --showperf and --perflimit
- Lots of refactoring and cleanup of how actions handle arguments.
- Do basic checks to figure out syslog file for 'logfile' action.
- Allow for exact matching of beta versions with 'version' action.
- Redo the default arguments to only populate when neither 'warning' nor 'critical' is provided.
- Allow just warning OR critical to be given for the 'timesync' action.
- Remove 'redirect_stderr' requirement from 'logfile' due to 8.3 changes.
- Actions 'last_vacuum' and 'last_analyze' are 8.2 only (Robert Treat)
+
Fixes, enhancements, and performance tracking.
+Add performance data tracking via --showperf and --perflimit
+Lots of refactoring and cleanup of how actions handle arguments.
+Do basic checks to figure out syslog file for 'logfile' action.
+Allow for exact matching of beta versions with 'version' action.
+Redo the default arguments to only populate when neither 'warning' nor 'critical' is provided.
+Allow just warning OR critical to be given for the 'timesync' action.
+Remove 'redirect_stderr' requirement from 'logfile' due to 8.3 changes.
+Actions 'last_vacuum' and 'last_analyze' are 8.2 only (Robert Treat)
Version 1.0.16 (December 7, 2007)
-
 First public release, December 2007
+
First public release, December 2007
@@ -2636,30 +2671,30 @@

NAGIOS EXAMPLES

Some example Nagios configuration settings using this script:

-
 define command {
-     command_name    check_postgres_size
-     command_line    $USER2$/check_postgres.pl -H $HOSTADDRESS$ -u pgsql -db postgres --action database_size -w $ARG1$ -c $ARG2$
- }
+
define command {
+    command_name    check_postgres_size
+    command_line    $USER2$/check_postgres.pl -H $HOSTADDRESS$ -u pgsql -db postgres --action database_size -w $ARG1$ -c $ARG2$
+}
 
- define command {
-     command_name    check_postgres_locks
-     command_line    $USER2$/check_postgres.pl -H $HOSTADDRESS$ -u pgsql -db postgres --action locks -w $ARG1$ -c $ARG2$
- }
+define command {
+    command_name    check_postgres_locks
+    command_line    $USER2$/check_postgres.pl -H $HOSTADDRESS$ -u pgsql -db postgres --action locks -w $ARG1$ -c $ARG2$
+}
 
 
- define service {
-     use                    generic-other
-     host_name              dbhost.gtld
-     service_description    dbhost PostgreSQL Service Database Usage Size
-     check_command          check_postgres_size!256000000!512000000
- }
+define service {
+    use                    generic-other
+    host_name              dbhost.gtld
+    service_description    dbhost PostgreSQL Service Database Usage Size
+    check_command          check_postgres_size!256000000!512000000
+}
 
- define service {
-     use                    generic-other
-     host_name              dbhost.gtld
-     service_description    dbhost PostgreSQL Service Database Locks
-     check_command          check_postgres_locks!2!3
- }
+define service { + use generic-other + host_name dbhost.gtld + service_description dbhost PostgreSQL Service Database Locks + check_command check_postgres_locks!2!3 +}

LICENSE AND COPYRIGHT

@@ -2667,11 +2702,11 @@

LICENSE AND COPYRIGHT

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

-
  1. Redistributions of source code must retain the above copyright notice, 
-     this list of conditions and the following disclaimer.
-  2. Redistributions in binary form must reproduce the above copyright notice, 
-     this list of conditions and the following disclaimer in the documentation 
-     and/or other materials provided with the distribution.
+
1. Redistributions of source code must retain the above copyright notice, 
+   this list of conditions and the following disclaimer.
+2. Redistributions in binary form must reproduce the above copyright notice, 
+   this list of conditions and the following disclaimer in the documentation 
+   and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

From ba25b10a040839e80f061041e0a5aa5ece8a6ff0 Mon Sep 17 00:00:00 2001 From: Greg Sabino Mullane Date: Thu, 4 Jan 2024 10:49:17 -0500 Subject: [PATCH 271/272] Bump copyright to 2024 --- LICENSE | 2 +- README.md | 2 +- check_postgres.pl | 4 ++-- check_postgres.pl.html | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/LICENSE b/LICENSE index a8fda705..eedf8c74 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright 2007 - 2023 Greg Sabino Mullane +Copyright 2007 - 2024 Greg Sabino Mullane Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/README.md b/README.md index b801c655..fa8c9bb0 100644 --- a/README.md +++ b/README.md @@ -78,7 +78,7 @@ https://bucardo.org/mailman/listinfo/check_postgres COPYRIGHT --------- - Copyright 2007 - 2023 Greg Sabino Mullane + Copyright 2007 - 2024 Greg Sabino Mullane LICENSE INFORMATION ------------------- diff --git a/check_postgres.pl b/check_postgres.pl index c3f14093..d88cad75 100755 --- a/check_postgres.pl +++ b/check_postgres.pl @@ -11460,7 +11460,7 @@ =head1 HISTORY (Github user miraclesvenni) [Github issue #154] - Raise minimum version or Perl to 5.10.0 + Raise minimum version of Perl to 5.10.0 Allow commas in passwords via --dbpass for one-connection queries (Greg Sabino Mullane) [Github issue #133] @@ -12333,7 +12333,7 @@ =head1 NAGIOS EXAMPLES =head1 LICENSE AND COPYRIGHT -Copyright 2007 - 2023 Greg Sabino Mullane . +Copyright 2007 - 2024 Greg Sabino Mullane . Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/check_postgres.pl.html b/check_postgres.pl.html index 52706026..8a5b14c5 100644 --- a/check_postgres.pl.html +++ b/check_postgres.pl.html @@ -2698,7 +2698,7 @@

NAGIOS EXAMPLES

LICENSE AND COPYRIGHT

-

Copyright 2007 - 2023 Greg Sabino Mullane <greg@turnstep.com>.

+

Copyright 2007 - 2024 Greg Sabino Mullane <greg@turnstep.com>.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

From 8a23adc3e19ccb6fd6b38629192e82eb3cb34a3b Mon Sep 17 00:00:00 2001 From: Greg Sabino Mullane Date: Wed, 1 Jan 2025 21:31:44 -0500 Subject: [PATCH 272/272] Bump copyright to 2025 --- LICENSE | 2 +- README.md | 2 +- check_postgres.pl | 2 +- check_postgres.pl.html | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/LICENSE b/LICENSE index eedf8c74..95cadcac 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright 2007 - 2024 Greg Sabino Mullane +Copyright 2007 - 2025 Greg Sabino Mullane Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/README.md b/README.md index fa8c9bb0..72adeb84 100644 --- a/README.md +++ b/README.md @@ -78,7 +78,7 @@ https://bucardo.org/mailman/listinfo/check_postgres COPYRIGHT --------- - Copyright 2007 - 2024 Greg Sabino Mullane + Copyright 2007 - 2025 Greg Sabino Mullane LICENSE INFORMATION ------------------- diff --git a/check_postgres.pl b/check_postgres.pl index d88cad75..928f39a6 100755 --- a/check_postgres.pl +++ b/check_postgres.pl @@ -12333,7 +12333,7 @@ =head1 NAGIOS EXAMPLES =head1 LICENSE AND COPYRIGHT -Copyright 2007 - 2024 Greg Sabino Mullane . +Copyright 2007 - 2025 Greg Sabino Mullane . Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: diff --git a/check_postgres.pl.html b/check_postgres.pl.html index 8a5b14c5..6abc9842 100644 --- a/check_postgres.pl.html +++ b/check_postgres.pl.html @@ -2698,7 +2698,7 @@

NAGIOS EXAMPLES

LICENSE AND COPYRIGHT

-

Copyright 2007 - 2024 Greg Sabino Mullane <greg@turnstep.com>.

+

Copyright 2007 - 2025 Greg Sabino Mullane <greg@turnstep.com>.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy