From b80ce63c858fa922aeb858d573216b233195b26a Mon Sep 17 00:00:00 2001 From: Greg Sabino Mullane Date: Thu, 3 Dec 2009 07:47:07 -0500 Subject: Bump version to 2.13.0, add the "tempdir" argument. --- check_postgres.pl | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'check_postgres.pl') diff --git a/check_postgres.pl b/check_postgres.pl index 11a3348ab..f9837f169 100755 --- a/check_postgres.pl +++ b/check_postgres.pl @@ -29,7 +29,7 @@ $Data::Dumper::Varname = 'POSTGRES'; $Data::Dumper::Indent = 2; $Data::Dumper::Useqq = 1; -our $VERSION = '2.12.0'; +our $VERSION = '2.13.0'; use vars qw/ %opt $PSQL $res $COM $SQL $db /; @@ -694,6 +694,7 @@ die $USAGE unless 'PSQL=s', + 'tempdir=s', 'get_method=s', 'language=s', 'mrtg=s', ## used by MRTG checks only @@ -1713,7 +1714,11 @@ sub run_command { } ## Create a temp file to store our results - $tempdir = tempdir(CLEANUP => 1); + my @tempdirargs = (CLEANUP => 1); + if ($opt{tempdir}) { + push @tempdirargs => 'DIR', $opt{tempdir}; + } + $tempdir = tempdir(@tempdirargs); ($tempfh,$tempfile) = tempfile('check_postgres_psql.XXXXXXX', SUFFIX => '.tmp', DIR => $tempdir); ## Create another one to catch any errors @@ -6446,7 +6451,7 @@ sub show_dbstats { B - a Postgres monitoring script for Nagios, MRTG, Cacti, and others -This documents describes check_postgres.pl version 2.12.0 +This documents describes check_postgres.pl version 2.13.0 =head1 SYNOPSIS @@ -7903,6 +7908,11 @@ Items not specifically attributed are by Greg Sabino Mullane. =over 4 +=item B + + Allow the temporary directory to be specified via the "tempdir" argument, for + systems that need it (e.g. /tmp is not owned by root). + =item B Fix so old versions of Postgres (< 8.0) use the correct default database (Giles Westwood) -- cgit v1.2.3