$Data::Dumper::Indent = 2;
$Data::Dumper::Useqq = 1;
-our $VERSION = '2.3.4';
+our $VERSION = '2.3.5';
use vars qw/ %opt $PSQL $res $COM $SQL $db /;
'logfile=s', ## used by check_logfile only
'queryname=s', ## used by query_runtime only
'query=s', ## used by custom_query only
- 'checktype=s', ## used by custom_query only
+ 'valtype=s', ## used by custom_query only
'reverse', ## used by custom_query only
'repinfo=s', ## used by replicate_row only
'schema=s', ## used by fsm_* checks only
## Run a user-supplied query, then parse the results
## If you end up using this to make a useful query, consider making it
## into a specific action and sending in a patch!
- ## Checktype must be one of: string, time, size, integer
+ ## valtype must be one of: string, time, size, integer
- my $valtype = $opt{checktype} || 'integer';
+ my $valtype = $opt{valtype} || 'integer';
my ($warning, $critical) = validate_range({type => $valtype, leastone => 1});
=head1 NAME
B<check_postgres.pl> - a Postgres monitoring script for Nagios, MRTG, and others
-This documents describes check_postgres.pl version 2.3.4
+This documents describes check_postgres.pl version 2.3.5
=head1 SYNOPSIS
is the result that will be checked, and the second is any performance data you want sent.
At least one warning or critical argument must be specified. What these are set to depends on the type of
-query you are running. There are four types of custom_queries that can be run, specified by the C<checktype>
+query you are running. There are four types of custom_queries that can be run, specified by the C<valtype>
argument. If none is specified, this action defaults to 'integer'. The four types are:
B<integer>:
Example 1: Warn if any relation over 100 pages is named "rad":
- check_postgres_custom_query --checktype=string -w "rad" --query="SELECT relname FROM pg_class WHERE relpages > 100" --port=5432
+ check_postgres_custom_query --valtype=string -w "rad" --query="SELECT relname FROM pg_class WHERE relpages > 100" --port=5432
Example 2: Give a critical if the "foobar" function returns a number over 5MB:
- check_postgres_custom_query --port=5432 --critical='5MB'--checktype=size --query="SELECT foobar()"
+ check_postgres_custom_query --port=5432 --critical='5MB'--valtype=size --query="SELECT foobar()"
Example 2: Warn if the function "snazzo" returns less than 42:
=over 4
+=item B<Version 2.3.5>
+
+ Change option 'checktype' to 'valtype' to prevent collisions with -c[ritical]
+
=item B<Version 2.3.4>
Do explicit cleanups of the temp directory, per problems reported by sb@nnx.com.