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.
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 (in this order):
20 · /etc/pcpdbi.conf
21 · $PCP_PMDAS_DIR/postgresql/postgresql.conf
22 · ./postgresql.conf
23
24 This file can contain overridden values (Perl code) for the settings
25 listed at the start of pmdapostgresql.pl, for example:
26 · $database - database access method and database name, [default:
27 'dbi:Pg:dbname=postgres'] (see DBI(3) for details)
28 · $username - username to connect to the database [default: 'post‐
29 gres']
30 · $password - password to connect to the database [default: '']
31 · $os_user - operating system username (PMDA will run with the corre‐
32 sponding user id, if invoked as root) [default: $username]
33
34 Once this is setup, you can access the names and values for the post‐
35 gresql performance metrics by doing the following as root:
36
37 # cd $PCP_PMDAS_DIR/postgresql
38 # ./Install
39
40 To uninstall, do the following as root:
41
42 # cd $PCP_PMDAS_DIR/postgresql
43 # ./Remove
44
45 pmdapostgresql is launched by pmcd(1) and should never be executed
46 directly. The Install and Remove scripts notify pmcd(1) when the agent
47 is installed or removed.
48
49 pmdapostgresql will automatically attempt to reconnect to the post‐
50 gresql server if it's connection is lost - e.g. if the postgresql ser‐
51 vice is restarted. In addition, pmdapostgresql will disconnect if it
52 is sent a SIGUSR1 signal, and will then attempt to reconnect on the
53 next fetch. This is mostly for quality assurance and test purposes,
54 but may be useful in other circumstances.
55
57 pmdapostgresql has been tested and verified with postgresql server,
58 version 9.6.7 and earlier. The verification was done using the
59 pgbench(1) utility. It has not (yet) been tested or verified with
60 postgresql version 10.x.
61
63 /etc/pcpdbi.conf
64 configuration file for all PCP database monitors
65 $PCP_PMDAS_DIR/postgresql/postgresql.conf
66 configuration file for pmdapostgresql
67 $PCP_PMDAS_DIR/postgresql/Install
68 installation script for the pmdapostgresql agent
69 $PCP_PMDAS_DIR/postgresql/Remove
70 undo installation script for the pmdapostgresql agent
71 $PCP_LOG_DIR/pmcd/postgresql.log
72 default log file for error messages from pmdapostgresql
73
75 Environment variables with the prefix PCP_ are used to parameterize the
76 file and directory names used by PCP. On each installation, the file
77 /etc/pcp.conf contains the local values for these variables. The
78 $PCP_CONF variable may be used to specify an alternative configuration
79 file, as described in pcp.conf(5).
80
82 PCPIntro(1), pmdadbping(1) and DBI(3).
83
84
85
86Performance Co-Pilot PCP PMDAPOSTGRESQL(1)