summaryrefslogtreecommitdiff
path: root/check_postgres.pl
diff options
context:
space:
mode:
authorGreg Sabino Mullane2009-08-06 21:51:45 +0000
committerGreg Sabino Mullane2009-08-06 21:51:45 +0000
commit46b0516cce304efa8870294cd7d6fe409658b4bc (patch)
tree05b426a3f1ea5ef99b236c4f051919357eefef07 /check_postgres.pl
parentedd4b6e9acb3d2d338fb737435f439d30941a39f (diff)
Add --language option.
Diffstat (limited to 'check_postgres.pl')
-rwxr-xr-xcheck_postgres.pl14
1 files changed, 13 insertions, 1 deletions
diff --git a/check_postgres.pl b/check_postgres.pl
index 605a3317c..cdf9dcad1 100755
--- a/check_postgres.pl
+++ b/check_postgres.pl
@@ -674,6 +674,7 @@ die $USAGE unless
'PSQL=s',
'get_method=s',
+ 'language=s',
'mrtg=s', ## used by MRTG checks only
'logfile=s', ## used by check_logfile only
'queryname=s', ## used by query_runtime only
@@ -710,6 +711,11 @@ if ($opt{get_method}) {
}
}
+## Allow the language to be changed by an explicit option
+if ($opt{language}) {
+ $lang = substr($opt{language},0,2);
+}
+
## Output the actual string returned by psql in the normal output
## Argument is 'a' for all, 'w' for warning, 'c' for critical, 'u' for unknown
## Can be grouped together
@@ -6508,8 +6514,13 @@ the folling line in their C<.check_postgresrc> file:
get_method=fetch
-=back
+=item B<--language=VAL>
+Set the language to use for all output messages. Normally, this is detected by examining
+the environment variables LC_ALL, LC_MESSAGES, and LANG, but setting this option
+will override any such detection.
+
+=back
=head1 ACTIONS
@@ -7668,6 +7679,7 @@ Items not specifically attributed are by Greg Sabino Mullane.
Add Nagios perf output to the wal_files check (Cédric Villemain)
Add support for .check_postgresrc, per request from Albe Laurenz.
Allow list of web fetch methods to be changed with the --get_method option.
+ Add support for the --language argument, which overrides any ENV.
=item B<Version 2.10.0> (August 3, 2009)