'\"macro stdmacro .\" .\" Copyright (c) 2018 Red Hat. All Rights Reserved. .\" Copyright (c) 2009 Aconex. All Rights Reserved. .\" .\" This program is free software; you can redistribute it and/or modify it .\" under the terms of the GNU General Public License as published by the .\" Free Software Foundation; either version 2 of the License, or (at your .\" option) any later version. .\" .\" This program is distributed in the hope that it will be useful, but .\" WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY .\" or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License .\" for more details. .\" .\" .TH PMDAPOSTGRESQL 1 "PCP" "Performance Co-Pilot" .SH NAME \f3pmdapostgresql\f1 \- PostgreSQL database PMDA .SH DESCRIPTION \f3pmdapostgresql\f1 is a Performance Co-Pilot \s-1PMDA\s0 which extracts live performance data from a running PostgreSQL database server. .PP Many of the staticstics available from a PostgreSQL server may not be enabled by default. Refer to the online documentation at .I https://www.postgresql.org/docs/current/static/monitoring-stats.html which describes each of the available parameters related to statistics collection and how to enable them. .SH INSTALLATION \f3pmdapostgresql\f1 uses a configuration file from \&\f(CW$PCP_PMDAS_DIR\fR/postgresql/postgresql.conf .PP This file currently contains only one section .B [authentication] which specifies values for the following default settings: .IP "\(bu" 4 host \- hostname, [default: 'local'] .IP "\(bu" 4 port \- port number, [default: '5432'] .IP "\(bu" 4 dbname \- database name, [default: 'postgres'] .IP "\(bu" 4 username \- username to run as and to connect to the database [default: 'postgres'] .IP "\(bu" 4 password \- password to connect to the database [default: 'password'] .IP "\(bu" 4 osuser \- operating system user the PMDA runs as [default: not set] .PD .PP The defaults (as above) will result in the PMDA running as the current user, using a UNIX domain socket connection to the PostgreSQL server on the localhost. If .B osuser is not specified in the configuration file, the PMDA will run as the current user. A host specification of "local" will use a UNIX domain socket, which uses peer authentication, see comments in the .B pg_hba.conf file. In this case, the .B osuser setting should probably be set to .BR postgres . .PP It is generally not necessary to alter the default configuration file for monitoring the local PostgreSQL server instance with a default server configuration. Note the port number is required even for a UNIX domain connection because it's used as the socket filename by the server. .PP Once this is setup, you can access the names and values for the postgresql performance metrics by doing the following as root: .PP # cd $PCP_PMDAS_DIR/postgresql .br # ./Install .PP To uninstall, do the following as root: .PP # cd $PCP_PMDAS_DIR/postgresql .br # ./Remove .PP \fBpmdapostgresql\fR is launched by \fIpmcd\fR(1) and should never be executed directly. The Install and Remove scripts notify \fIpmcd\fR(1) when the agent is installed or removed. .PP \fBpmdapostgresql\fR will automatically attempt to reconnect to the PostgreSQL server if it's connection is lost - e.g. if the PostgreSQL service is restarted. .SH "SUPPORTED VERSIONS" \fBpmdapostgresql\fR has been tested and verified with PostgreSQL server version .B 10.2 and earlier. Later versions will probably also work correctly because the PMDA probes the various performance tables on start-up to determine the column ordering. It also tolerates missing or renamed tables and/or columns. .SH FILES .IP "\fB$PCP_PMDAS_DIR/postgresql/pmdapostgresql.conf\f1" configuration file for \fBpmdapostgresql\fR .IP "\fB$PCP_PMDAS_DIR/postgresql/Install\fR" 4 installation script for the \fBpmdapostgresql\fR agent .IP "\fB$PCP_PMDAS_DIR/postgresql/Remove\fR" 4 undo installation script for the \fBpmdapostgresql\fR agent .IP "\fB$PCP_LOG_DIR/pmcd/postgresql.log\fR" 4 default log file for error messages from \fBpmdapostgresql\fR .PP Note the usual/default value for \fB$PCP_PMDAS_DIR\fP is .B /var/lib/pcp/pmdas and the default for \fB$PCP_LOG_DIR\fP is .B /var/log/pcp but these settings are platform dependent. .PD .SH PCP ENVIRONMENT Environment variables with the prefix \fBPCP_\fR are used to parameterize the file and directory names used by \fBPCP\fR. On each installation, the file \fB/etc/pcp.conf\fR contains the local values for these variables. The \fB$PCP_CONF\fR variable may be used to specify an alternative configuration file, as described in \fIpcp.conf\fR(5). .SH SEE ALSO .BR PCPIntro (1), .BR PMCD (1) and .B https://www.postgresql.org/docs/current/static/monitoring-stats.html