1PMDAPOSTGRESQL(1) General Commands Manual PMDAPOSTGRESQL(1)
2
3
4
6 pmdapostgresql - PostgreSQL database PMDA
7
9 pmdapostgresql is a Performance Co-Pilot PMDA which extracts live per‐
10 formance data from a running PostgreSQL database server.
11
12 Many of the staticstics available from a PostgreSQL server may not be
13 enabled by default. Refer to the online documentation at
14 https://www.postgresql.org/docs/current/static/monitoring-stats.html
15 which describes each of the available parameters related to statistics
16 collection and how to enable them.
17
19 pmdapostgresql uses a configuration file from $PCP_PMDAS_DIR/post‐
20 gresql/postgresql.conf
21
22 This file currently contains only one section [authentication] which
23 specifies values for the following default settings:
24
25 · host - hostname, [default: 'local']
26
27 · port - port number, [default: '5432']
28
29 · dbname - database name, [default: 'postgres']
30
31 · username - username to run as and to connect to the database
32 [default: 'postgres']
33
34 · password - password to connect to the database [default: 'pass‐
35 word']
36
37 · osuser - operating system user the PMDA runs as [default: not set]
38
39 The defaults (as above) will result in the PMDA running as the current
40 user, using a UNIX domain socket connection to the PostgreSQL server on
41 the localhost. If osuser is not specified in the configuration file,
42 the PMDA will run as the current user. A host specification of "local"
43 will use a UNIX domain socket, which uses peer authentication, see com‐
44 ments in the pg_hba.conf file. In this case, the osuser setting should
45 probably be set to postgres.
46
47 It is generally not necessary to alter the default configuration file
48 for monitoring the local PostgreSQL server instance with a default
49 server configuration. Note the port number is required even for a UNIX
50 domain connection because it's used as the socket filename by the
51 server.
52
53 Once this is setup, you can access the names and values for the post‐
54 gresql performance metrics by doing the following as root:
55
56 # cd $PCP_PMDAS_DIR/postgresql
57 # ./Install
58
59 To uninstall, do the following as root:
60
61 # cd $PCP_PMDAS_DIR/postgresql
62 # ./Remove
63
64 pmdapostgresql is launched by pmcd(1) and should never be executed
65 directly. The Install and Remove scripts notify pmcd(1) when the agent
66 is installed or removed.
67
68 pmdapostgresql will automatically attempt to reconnect to the Post‐
69 greSQL server if it's connection is lost - e.g. if the PostgreSQL ser‐
70 vice is restarted.
71
73 pmdapostgresql has been tested and verified with PostgreSQL server ver‐
74 sion 10.2 and earlier. Later versions will probably also work cor‐
75 rectly because the PMDA probes the various performance tables on start-
76 up to determine the column ordering. It also tolerates missing or
77 renamed tables and/or columns.
78
80 $PCP_PMDAS_DIR/postgresql/pmdapostgresql.conf
81 configuration file for pmdapostgresql
82
83 $PCP_PMDAS_DIR/postgresql/Install
84 installation script for the pmdapostgresql agent
85
86 $PCP_PMDAS_DIR/postgresql/Remove
87 undo installation script for the pmdapostgresql agent
88
89 $PCP_LOG_DIR/pmcd/postgresql.log
90 default log file for error messages from pmdapostgresql
91
92 Note the usual/default value for $PCP_PMDAS_DIR is /var/lib/pcp/pmdas
93 and the default for $PCP_LOG_DIR is /var/log/pcp but these settings are
94 platform dependent.
95
97 Environment variables with the prefix PCP_ are used to parameterize the
98 file and directory names used by PCP. On each installation, the file
99 /etc/pcp.conf contains the local values for these variables. The
100 $PCP_CONF variable may be used to specify an alternative configuration
101 file, as described in pcp.conf(5).
102
104 PCPIntro(1), PMCD(1) and https://www.postgresql.org/docs/cur‐
105 rent/static/monitoring-stats.html
106
107
108
109Performance Co-Pilot PCP PMDAPOSTGRESQL(1)