summaryrefslogtreecommitdiff
path: root/check_postgres.pl
diff options
context:
space:
mode:
authorRyan P. Kelly2012-05-17 22:11:47 +0000
committerRyan P. Kelly2012-05-17 22:11:47 +0000
commit84972b37dee19a9f9905ee1baea6d0ce34284694 (patch)
treec6ee5a1f9f89a2f4e9ec806e86c3dbdcb494a184 /check_postgres.pl
parenteba4515da0ccb77160e2041436cfcc58d12ab1af (diff)
parente51cfaa0421c53c5cbe79839601828ecaaa70ffc (diff)
Merge remote branch 'bucardo/master' into f0rk/empty_tables_bloat
Diffstat (limited to 'check_postgres.pl')
-rwxr-xr-xcheck_postgres.pl29
1 files changed, 19 insertions, 10 deletions
diff --git a/check_postgres.pl b/check_postgres.pl
index 7e03472fa..47243b14b 100755
--- a/check_postgres.pl
+++ b/check_postgres.pl
@@ -7052,14 +7052,15 @@ sub find_catalog_info {
## For a function, we also want to put the args into the name
if ($type eq 'function') {
- ## Grab all type mappings
- $SQL = 'SELECT oid, typname FROM pg_type';
- my %oid2type;
- my $tinfo = run_command($SQL, { dbnumber => $dbnum });
- for my $row (@{ $tinfo->{db}[0]{slurp} }) {
- $oid2type{$row->{oid}} = $row->{typname};
- }
- (my $args = $row->{proargtypes}) =~ s/(\d+)/$oid2type{$1}||$1/ge;
+ ## Once per database, grab all mappings
+ if (! exists $opt{oid2type}{$dbnum}) {
+ $SQL = 'SELECT oid, typname FROM pg_type';
+ my $tinfo = run_command($SQL, { dbnumber => $dbnum });
+ for my $row (@{ $tinfo->{db}[0]{slurp} }) {
+ $opt{oid2type}{$dbnum}{$row->{oid}} = $row->{typname};
+ }
+ }
+ (my $args = $row->{proargtypes}) =~ s/(\d+)/$opt{oid2type}{$dbnum}{$1}||$1/ge;
$args =~ s/ /,/g;
$args =~ s/ints/smallint/g;
$args =~ s/int4/int/g;
@@ -7155,6 +7156,7 @@ FROM (
JOIN pg_namespace nsp ON nsp.oid = relnamespace
WHERE relkind = 'S'
) AS seqs
+WHERE nspname !~ '^pg_temp.*'
ORDER BY nspname, seqname, typname
};
## use critic
@@ -7988,10 +7990,17 @@ Instead, one should use a .pgpass or pg_service.conf file.
=item B<--dbservice=NAME>
-The name of a service inside of the pg_service.conf file. This file is in your home directory by
-default and contains a simple list of connection options. You can also pass additional information
+The name of a service inside of the pg_service.conf file. Before version 9.0 of Postgres, this is
+a global file, usually found in /etc/pg_service.conf. If you are using version 9.0 or higher of
+Postgres, you can use the file ".pg_service.conf" in the home directory of the user running
+the script, e.g. nagios.
+
+This file contains a simple list of connection options. You can also pass additional information
when using this option such as --dbservice="maindatabase sslmode=require"
+The documentation for this file can be found at
+http://www.postgresql.org/docs/current/static/libpq-pgservice.html
+
=back
The database connection options can be grouped: I<--host=a,b --host=c --port=1234 --port=3344>