Cast to numeric to avoid bigint out of range errors in the check_sequence check.
authorGreg Sabino Mullane <greg@endpoint.com>
Wed, 5 Nov 2008 18:05:06 +0000 (13:05 -0500)
committerGreg Sabino Mullane <greg@endpoint.com>
Wed, 5 Nov 2008 18:05:06 +0000 (13:05 -0500)
Bump version to 2.4.1

check_postgres.pl
check_postgres.pl.asc
check_postgres.pl.html
index.html

index 9d28779235b7483870b9bd0b83cbc1dd089b9193..094483771073c9a0c8ff0b37f6bf40f05c591cc8 100755 (executable)
@@ -28,7 +28,7 @@ $Data::Dumper::Varname = 'POSTGRES';
 $Data::Dumper::Indent = 2;
 $Data::Dumper::Useqq = 1;
 
-our $VERSION = '2.4.0';
+our $VERSION = '2.4.1';
 
 use vars qw/ %opt $PSQL $res $COM $SQL $db /;
 
@@ -3623,8 +3623,8 @@ sub check_sequence {
                        my ($schema, $seq, $seqname) = ($1,$2,$3);
                        next if skip_item($seq);
                        $SQL = q{SELECT last_value, slots, used, ROUND(used/slots*100) AS percent, slots - used AS numleft FROM }.
-                               q{ (SELECT last_value, CEIL((max_value-min_value+1)/increment_by::NUMERIC) AS slots,}.
-                               qq{ CEIL((last_value-min_value+1)/increment_by::NUMERIC) AS used FROM $seqname) foo};
+                               q{ (SELECT last_value, CEIL((max_value-min_value::numeric+1)/increment_by::NUMERIC) AS slots,}.
+                               qq{ CEIL((last_value-min_value::numeric+1)/increment_by::NUMERIC) AS used FROM $seqname) foo};
                        my $seqinfo = run_command($SQL, { target => $db });
                        if (!defined $seqinfo->{db}[0] or $seqinfo->{db}[0]{slurp} !~ /(\d+)\D+(\d+)\D+(\d+)\D+(\d+)\D+(\d+)/) {
                                ndie "Could not determine information about sequence $seqname";
@@ -3725,7 +3725,7 @@ sub show_dbstats {
 =head1 NAME
 
 B<check_postgres.pl> - a Postgres monitoring script for Nagios, MRTG, Cacti, and others
-This documents describes check_postgres.pl version 2.4.0
+This documents describes check_postgres.pl version 2.4.1
 
 =head1 SYNOPSIS
 
@@ -4942,6 +4942,11 @@ Items not specifically attributed are by Greg Sabino Mullane.
 
 =over 4
 
+=item B<Version 2.4.1>
+
+  Cast numbers to numeric to support sequences ranges > bigint in check_sequence action.
+  Thanks to Scott Marlowe for reporting this.
+
 =item B<Version 2.4.0>
 
  Add Cacti support with the dbstats action.
index a0a1aae957e8a311c3539238269df9b52253e6e3..4089a42502d5cc4ddd11ac16ca9e83217646ee16 100644 (file)
@@ -1,6 +1,6 @@
 -----BEGIN PGP SIGNATURE-----
 
-iEYEABEDAAYFAkkE1CQACgkQvJuQZxSWSshOLACfY520+UFybHaBLDg4j9bxdDNR
-wzsAnjo7kFvAWhMZMY19f9zlqu4IjXou
-=VHPI
+iEYEABEDAAYFAkkR4C4ACgkQvJuQZxSWSshcOACfeVZ8AWBfSRQIORPd5pL51TUr
+fGwAoOmcRxDE7BQ+IwoAwc/2OV47ea96
+=eLTc
 -----END PGP SIGNATURE-----
index e5e1fc2ea1d302bad5a4a4f3110e63f3cdaae8a3..d3cec38b1f926a7ca403408e654e6bd9640276d4 100644 (file)
@@ -92,7 +92,7 @@
 <hr />
 <h1><a name="name">NAME</a></h1>
 <p><strong>check_postgres.pl</strong> - a Postgres monitoring script for Nagios, MRTG, Cacti, and others
-This documents describes check_postgres.pl version 2.4.0</p>
+This documents describes check_postgres.pl version 2.4.1</p>
 <p>
 </p>
 <hr />
@@ -1203,6 +1203,13 @@ feature requests, and commit notices, send email to <a href="mailto:check_postgr
 <h1><a name="history">HISTORY</a></h1>
 <p>Items not specifically attributed are by Greg Sabino Mullane.</p>
 <dl>
+<dt><strong><a name="item_version_2_2e4_2e1"><strong>Version 2.4.1</strong></a></strong></dt>
+
+<dd>
+<pre>
+  Cast numbers to numeric to support sequences ranges &gt; bigint in check_sequence action.
+  Thanks to Scott Marlowe for reporting this.</pre>
+</dd>
 <dt><strong><a name="item_version_2_2e4_2e0"><strong>Version 2.4.0</strong></a></strong></dt>
 
 <dd>
index cd198b6ce9d4d635676b73e81bba89250cfd5804..ee30b96b78dcc0c6996546e75323e35d5565ba28 100644 (file)
@@ -21,14 +21,14 @@ h1 {
 
 <h1>check_postgres.pl</h1>
 
-<p><b>check_postgres.pl</b> is a script for checking the state of one or more Postgres databases and reporting back in a Nagios-friendly manner. It was developed by Greg Sabino Mullane of <a href="http://www.endpoint.com/">End Point Corporation</a> and is BSD-licensed. The latest version is <b>2.4.0</b>, and was released on October 26, 2008.</p>
+<p><b>check_postgres.pl</b> is a script for checking the state of one or more Postgres databases and reporting back in a Nagios-friendly manner. It was developed by Greg Sabino Mullane of <a href="http://www.endpoint.com/">End Point Corporation</a> and is BSD-licensed. The latest version is <b>2.4.1</b>, and was released on November 05, 2008.</p>
 
 <ul>
- <li><a href="/check_postgres/check_postgres.pl.html">Documentation for check_postgres 2.4.0</a></li>
+ <li><a href="/check_postgres/check_postgres.pl.html">Documentation for check_postgres 2.4.1</a></li>
 </ul>
 <ul>
- <li><a href="/check_postgres/check_postgres.pl">Download check_postgres.pl 2.4.0</a></li>
- <li><a href="/check_postgres/check_postgres.pl.asc">PGP signature for check_postgres.pl 2.4.0</a></li>
+ <li><a href="/check_postgres/check_postgres.pl">Download check_postgres.pl 2.4.1</a></li>
+ <li><a href="/check_postgres/check_postgres.pl.asc">PGP signature for check_postgres.pl 2.4.1</a></li>
 </ul>
 
 <p>The latest development version can be downloaded via git:</p>