[check_postgres] [check_postgres.pl] Bump version to 1.8.5, more minor perlcritic adjustments.

check_postgres at bucardo.org check_postgres at bucardo.org
Sun Jun 22 16:28:32 UTC 2008


Committed by Greg Sabino Mullane <greg at endpoint.com>

Bump version to 1.8.5, more minor perlcritic adjustments.

---
 .perlcriticrc          |    9 +++++----
 check_postgres.pl      |   20 ++++++++++----------
 check_postgres.pl.html |    9 ++++++++-
 index.html             |    6 +++---
 4 files changed, 26 insertions(+), 18 deletions(-)

diff --git a/.perlcriticrc b/.perlcriticrc
index 44cba5a..898a410 100644
--- a/.perlcriticrc
+++ b/.perlcriticrc
@@ -14,6 +14,7 @@ stop_words = Mullane Nagios Slony nols salesrep psql dbname postgres USERNAME us
 ## Severity 4:
 [-ErrorHandling::RequireUseOfExceptions]
 [-InputOutput::RequireBriefOpen]
+[-Modules::RequireExplicitInclusion]
 [-Subroutines::RequireFinalReturn]
 [-ValuesAndExpressions::ProhibitMixedBooleanOperators]
 
@@ -58,11 +59,11 @@ stop_words = Mullane Nagios Slony nols salesrep psql dbname postgres USERNAME us
 [-Variables::ProhibitPunctuationVars]
 
 ## Severity 1:
+[-BuiltinFunctions::ProhibitReverseSortBlock]
 [-CodeLayout::ProhibitParensWithBuiltins]
 [-CodeLayout::RequireTidyCode]
+[-Documentation::RequirePodAtEnd]
 [-InputOutput::RequireCheckedSyscalls]
-[-RegularExpressions::ProhibitUnusualDelimiters]
-[-BuiltinFunctions::ProhibitReverseSortBlock]
-[-RegularExpressions::ProhibitEscapedMetacharacters]
 [-RegularExpressions::ProhibitEnumeratedClasses]
-[-Documentation::RequirePodAtEnd]
+[-RegularExpressions::ProhibitEscapedMetacharacters]
+[-RegularExpressions::ProhibitUnusualDelimiters]
diff --git a/check_postgres.pl b/check_postgres.pl
index 2774a0b..6f1324b 100755
--- a/check_postgres.pl
+++ b/check_postgres.pl
@@ -21,7 +21,7 @@ use Getopt::Long qw/GetOptions/;
 Getopt::Long::Configure(qw/no_ignore_case/);
 use File::Basename qw/basename/;
 use File::Temp qw/tempfile tempdir/;
-File::Temp->safe_level( File::Temp::MEDIUM ); ## no critic
+File::Temp->safe_level( File::Temp::MEDIUM );
 use Cwd;
 use Data::Dumper qw/Dumper/;
 $Data::Dumper::Varname = 'POSTGRES';
@@ -256,8 +256,8 @@ build_symlinks() if $action =~ /build_symlinks/; ## Does not return, may be 'bui
 ## Die if Time::HiRes is needed but not found
 if ($opt{showtime}) {
 	eval {
-		require Time::HiRes; ## no critic
-		import Time::HiRes qw/gettimeofday tv_interval sleep/; ## no critic
+		require Time::HiRes;
+		import Time::HiRes qw/gettimeofday tv_interval sleep/;
 	};
 	if ($@) {
 		die qq{Cannot find Time::HiRes, needed if 'showtime' is true\n};
@@ -326,7 +326,7 @@ sub add_response {
 	push @{$type->{$header}} => [$msg,$perf];
 }
 
-sub add_unknown { ## no critic
+sub add_unknown {
 	my $msg = shift || $db->{error};
 	add_response \%unknown, $msg;
 }
@@ -432,7 +432,7 @@ if ($opt{test}) {
 		}
 		print "Connection ok: $db->{pname}\n";
 		for (split /\n/ => $db->{slurp}) {
-			while (/(\S+)\s*\|\s*(.+)\s*/sg) { ## no critic 'ProhibitUnusedCapture'
+			while (/(\S+)\s*\|\s*(.+)\s*/sg) { ## no critic (ProhibitUnusedCapture)
 				$set{$db->{pname}}{$1} = $2;
 			}
 		}
@@ -835,7 +835,7 @@ sub run_command {
 		my $timeout = $arg->{timeout} || $opt{timeout};
 		alarm 0;
 
-		my $start = $opt{showtime} ? [gettimeofday()] : 0; ## no critic
+		my $start = $opt{showtime} ? [gettimeofday()] : 0;
 		open my $oldstderr, '>&', STDERR or ndie "Could not dupe STDERR\n";
 		open STDERR, '>', $errorfile or ndie qq{Could not open STDERR?!\n};
 		eval {
@@ -855,7 +855,7 @@ sub run_command {
 			}
 		}
 
-		$db->{totaltime} = sprintf '%.2f', $opt{showtime} ? tv_interval($start) : 0; ## no critic
+		$db->{totaltime} = sprintf '%.2f', $opt{showtime} ? tv_interval($start) : 0;
 
 		if ($res) {
 			$db->{fail} = $res;
@@ -1411,7 +1411,7 @@ ORDER BY wastedbytes DESC LIMIT $LIMIT
 		}
 		my $max = -1;
 		my $maxmsg = '?';
-	  SLURP: while ($db->{slurp} =~ /$L/gsm) { ## no critic 'ProhibitUselessRegexModifiers'
+	  SLURP: while ($db->{slurp} =~ /$L/gsm) { ## no critic (ProhibitUselessRegexModifiers)
 			my ($schema,$table,$tups,$pages,$otta,$bloat,$wp,$wb,$ws,
 				$index,$irows,$ipages,$iotta,$ibloat,$iwp,$iwb,$iws)
 				= ($1,$2,$3,$4,$5,$6,$7,$8,$9,$10,$11,$12,$13,$14,$15,$16,$17,$18);
@@ -1476,7 +1476,7 @@ sub check_connection {
 
 	## Parse it out and return our information
 	for $db (@{$info->{db}}) {
-		if ($db->{slurp} !~ /PostgreSQL (\S+)/o) { ## no critic 'ProhibitUnusedCapture'
+		if ($db->{slurp} !~ /PostgreSQL (\S+)/o) { ## no critic (ProhibitUnusedCapture)
 			add_unknown "T-BAD-QUERY $db->{slurp}";
 			next;
 		}
@@ -1721,7 +1721,7 @@ sub check_wal_files {
 	my ($warning, $critical) = validate_range({type => 'integer', leastone => 1});
 
 	## Figure out where the pg_xlog directory is
-	$SQL = q{SELECT count(*) FROM pg_ls_dir('pg_xlog') WHERE pg_ls_dir ~ E'^[0-9A-F]{24}$'}; ## no critic
+	$SQL = q{SELECT count(*) FROM pg_ls_dir('pg_xlog') WHERE pg_ls_dir ~ E'^[0-9A-F]{24}$'}; ## no critic (RequireInterpolationOfMetachars)
 
 	my $info = run_command($SQL);
 
diff --git a/check_postgres.pl.html b/check_postgres.pl.html
index 44b8fd7..b14a918 100644
--- a/check_postgres.pl.html
+++ b/check_postgres.pl.html
@@ -51,7 +51,7 @@
 </p>
 <hr />
 <h1><a name="version">VERSION</a></h1>
-<p>This documents describes <strong>check_postgres.pl</strong> version 1.8.4</p>
+<p>This documents describes <strong>check_postgres.pl</strong> version 1.8.5</p>
 <p>
 </p>
 <hr />
@@ -1170,6 +1170,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="5" class="item"><strong>Version 1.8.5</strong> (June 22, 2008)</a></strong>
+
+<dd>
+<p>Output schema name before table name where appropriate.
+Thanks to Jeff Frost.</p>
+</dd>
+</li>
 <dt><strong><a name="4" class="item"><strong>Version 1.8.4</strong> (June 19, 2008)</a></strong>
 
 <dd>
diff --git a/index.html b/index.html
index 3c56497..669ebce 100644
--- a/index.html
+++ b/index.html
@@ -21,13 +21,13 @@ 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>1.8.4</b>, and was released on June 19, 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>1.8.5</b>, and was released on June 22, 2008.</p>
 
 <ul>
- <li><a href="/check_postgres/check_postgres.pl.html">Documentation for check_postgres 1.8.4</a></li>
+ <li><a href="/check_postgres/check_postgres.pl.html">Documentation for check_postgres 1.8.5</a></li>
 </ul>
 <ul>
- <li><a href="/check_postgres/check_postgres.pl">Download check_postgres.pl 1.8.4</a></li>
+ <li><a href="/check_postgres/check_postgres.pl">Download check_postgres.pl 1.8.5</a></li>
  <li><a href="/check_postgres/check_postgres.pl.asc">PGP signature for check_postgres.pl</a></li>
 </ul>
 
-- 
1.5.5.4



More information about the Check_postgres mailing list