[check_postgres] [PATCH] Change autovac_freeze default warn/critical from 90%/95% to 105%/120%

Marti Raudsepp marti at juffo.org
Fri Oct 9 20:21:50 UTC 2009


Hi list!

I wrote a patch to do my suggested change to autovac_freeze defaults.
I have made a fork on the github website:

http://github.com/intgr/check_postgres/commit/edc13449eeb2cffcaf3137e1926db9f8c4034591
(git clone URL: git://github.com/intgr/check_postgres.git )

Marti

The patch follows:
-----
Author: Marti Raudsepp <marti at juffo.org>

Change autovac_freeze default warn/critical from 90%/95% to 105%/120%

Since autovacuum does not vacuum tables until they hit the
autovacuum_freeze_max_age
limit, setting these levels below 100% will return false positives.

diff --git a/check_postgres.pl b/check_postgres.pl
index 063cdc5..18e0083 100755
--- a/check_postgres.pl
+++ b/check_postgres.pl
@@ -2332,8 +2332,8 @@ sub check_autovac_freeze {
 	my ($warning, $critical) = validate_range
 		({
 		  type              => 'percent',
-		  default_warning   => '90%',
-		  default_critical  => '95%',
+		  default_warning   => '105%',
+		  default_critical  => '120%',
 		  forcemrtg         => 1,
 		  });

@@ -6749,13 +6749,14 @@ The current supported actions are:
 action will only work for databases version 8.2 or higher. The
I<--warning> and
 I<--critical> options should be expressed as percentages. The 'age'
of the transactions
 in each database is compared to the autovacuum_freeze_max_age setting
(200 million by default)
-to generate a rounded percentage. The default values are B<90%> for
the warning and B<95%> for
-the critical. Databases can be filtered by use of the I<--include>
and I<--exclude> options. See
-the L</"BASIC FILTERING"> section for more details.
+to generate a rounded percentage. The default values are B<105%> for
the warning and B<120%>
+for the critical. Since autovacuum does not vacuum tables before they
reach this limit,
+setting levels below 100% will return false positives. Databases can
be filtered by use of the
+I<--include> and I<--exclude> options. See the L</"BASIC FILTERING">
section for more details.

-Example 1: Give a warning when any databases on port 5432 are above 80%
+Example 1: Give a warning when any databases on port 5432 are above 100%

-  check_postgres_autovac_freeze --port=5432 --warning="80%"
+  check_postgres_autovac_freeze --port=5432 --warning="100%"

 For MRTG output, the highest overall percentage is reported on the
first line, and the highest age is
 reported on the second line. All databases which have the percentage
from the first line are reported
@@ -7896,6 +7897,10 @@ Items not specifically attributed are by Greg
Sabino Mullane.

 =over 4

+=item B<Version 2.12.2>
+
+  Change autovac_freeze default warn/critical from 90%/95% to 105%/120%
+
 =item B<Version 2.12.1>

   For "same_schema" trigger mismatches, show the attached table.
diff --git a/check_postgres.pl.html b/check_postgres.pl.html
index a2e4f7a..a769845 100644
--- a/check_postgres.pl.html
+++ b/check_postgres.pl.html
@@ -430,12 +430,13 @@ critical is an effective way to turn warnings
off and always give a critical.</p
 action will only work for databases version 8.2 or higher. The
<em>--warning</em> and
 <em>--critical</em> options should be expressed as percentages. The
'age' of the transactions
 in each database is compared to the autovacuum_freeze_max_age setting
(200 million by default)
-to generate a rounded percentage. The default values are
<strong>90%</strong> for the warning and <strong>95%</strong> for
-the critical. Databases can be filtered by use of the
<em>--include</em> and <em>--exclude</em> options. See
-the <a href="#basic_filtering">BASIC FILTERING</a> section for more
details.</p>
-<p>Example 1: Give a warning when any databases on port 5432 are above 80%</p>
+to generate a rounded percentage. The default values are
<strong>105%</strong> for the warning and <strong>120%</strong>
+for the critical. Since autovacuum does not vacuum tables before they
reach this limit,
+setting levels below 100% will return false positives. Databases can
be filtered by use of the
+<em>--include</em> and <em>--exclude</em> options. See the <a
href="#basic_filtering">BASIC FILTERING</a> section for more
details.</p>
+<p>Example 1: Give a warning when any databases on port 5432 are above 100%</p>
 <pre>
-  check_postgres_autovac_freeze --port=5432 --warning=&quot;80%&quot;</pre>
+  check_postgres_autovac_freeze --port=5432 --warning=&quot;100%&quot;</pre>
 <p>For MRTG output, the highest overall percentage is reported on the
first line, and the highest age is
 reported on the second line. All databases which have the percentage
from the first line are reported
 on the fourth line, separated by a pipe symbol.</p>


More information about the Check_postgres mailing list