Chapter 3. Installing PCP Packages
This procedure describes how to install the PCP packages.
Prerequisites
Ensure you have a minimum of 20 GB space available in the
/var/log/pcpdirectory.The default PCP data retention policy is to retain only that data collected during the past 14 days. Data storage per day is estimated to use usually between 100 MB and 500 MB of disk space, but may use up to several gigabytes.
- Ensure that the base system on which Satellite Server is running is Red Hat Enterprise Linux 7.6. or later. The minimum supported version for the PCP packages is PCP version 4.1.
Procedure
Enable the Red Hat Enterprise Linux
optionalrepository:subscription-manager repos --enable rhel-7-server-optional-rpms
# subscription-manager repos --enable rhel-7-server-optional-rpmsCopy to Clipboard Copied! Toggle word wrap Toggle overflow Install the PCP packages:
yum install pcp \ pcp-pmda-apache \ pcp-pmda-postgresql \ pcp-system-tools \ pcp-webjs
# yum install pcp \ pcp-pmda-apache \ pcp-pmda-postgresql \ pcp-system-tools \ pcp-webjsCopy to Clipboard Copied! Toggle word wrap Toggle overflow Enable and start the Performance Metrics Collector daemon, and the Performance Metrics Logger daemon:
systemctl enable pmcd pmlogger systemctl start pmcd pmlogger
# systemctl enable pmcd pmlogger # systemctl start pmcd pmloggerCopy to Clipboard Copied! Toggle word wrap Toggle overflow
3.1. Configuring PCP Data Collection Copy linkLink copied to clipboard!
This procedure describes how to configure PCP to collect metrics about processes, Satellite, Apache HTTP Server, and PostgreSQL.
Procedure
To configure PCP to collect data about Satellite processes, create the
/var/lib/pcp/pmdas/proc/hotproc.conffile and include the following content:Copy to Clipboard Copied! Toggle word wrap Toggle overflow By default, PCP collects basic system metrics. This step enables detailed metrics about the following Satellite processes:
- Java
- PostgreSQL
- MongoDB
- Dynflow
- Passenger
- Pulp
- Qpid
Configure PCP to log the process metrics being collected.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Install the process monitoring PMDA.
cd /var/lib/pcp/pmdas/proc ./Install
# cd /var/lib/pcp/pmdas/proc # ./InstallCopy to Clipboard Copied! Toggle word wrap Toggle overflow Configure PCP to collect metrics from Apache HTTP Server.
Enable the Apache HTTP Server extended status module.
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Enable the Apache HTTP Server PMDA.
cd /var/lib/pcp/pmdas/apache ./Install
# cd /var/lib/pcp/pmdas/apache # ./InstallCopy to Clipboard Copied! Toggle word wrap Toggle overflow Prevent the Satellite installer overwriting the extended status module’s configuration file.
Add the following line to the
/etc/foreman-installer/custom-hiera.yamlconfiguration file.apache::purge_configs: false
apache::purge_configs: falseCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Configure PCP to collect metrics from PostgreSQL.
Change to the
/var/lib/pcp/pmdas/postgresqldirectory.cd /var/lib/pcp/pmdas/postgresql
# cd /var/lib/pcp/pmdas/postgresqlCopy to Clipboard Copied! Toggle word wrap Toggle overflow Run the installer.
./Install
# ./InstallCopy to Clipboard Copied! Toggle word wrap Toggle overflow Configure the PCP database interface to permit access to the PostgreSQL database.
Edit the
/etc/pcpdbi.confconfiguration file, inserting the following lines:$database = "dbi:Pg:dbname=foreman;host=localhost"; $username = "foreman"; $password = "6qXfN9m5nii5iEcbz8nuiJBNsyjjdRHA"; $os_user = "foreman";
$database = "dbi:Pg:dbname=foreman;host=localhost"; $username = "foreman"; $password = "6qXfN9m5nii5iEcbz8nuiJBNsyjjdRHA";1 $os_user = "foreman";Copy to Clipboard Copied! Toggle word wrap Toggle overflow - 1
- The value for $password is stored in
/etc/foreman/database.ymlconfiguration file.
Change the SELinux
pcp_pmcd_tdomain permission to permit PCP access to the PostgreSQL database.semanage permissive -a pcp_pmcd_t
# semanage permissive -a pcp_pmcd_tCopy to Clipboard Copied! Toggle word wrap Toggle overflow Verify the PostgreSQL PMDA is able to connect to PostgreSQL.
Examine the
/var/log/pcp/pmcd/postgresql.logfile to confirm the connection is established. Without a successful database connection, the PostgreSQL PMDA will remain active, but not be able to provide any metrics.[Tue Aug 14 09:21:06] pmdapostgresql(25056) Info: PostgreSQL connection established
[Tue Aug 14 09:21:06] pmdapostgresql(25056) Info: PostgreSQL connection establishedCopy to Clipboard Copied! Toggle word wrap Toggle overflow If you find errors in
/var/log/pcp/pmcd/postgresql.log, restart the pmcd service.systemctl restart pmcd
# systemctl restart pmcdCopy to Clipboard Copied! Toggle word wrap Toggle overflow
Enable telemetry functionality in Satellite.
To enable collection of metrics from Satellite, you must send metrics via the
statsdprotocol into thepcp-mmvstatsddaemon. The metrics are aggregated and available via the PCP MMV API.Install the Foreman Telemetry and
pcp-mmvstatsdpackages.yum install foreman-telemetry pcp-mmvstatsd
# yum install foreman-telemetry pcp-mmvstatsdCopy to Clipboard Copied! Toggle word wrap Toggle overflow Enable and start the
pcp-mmvstatsdservice.systemctl enable pcp-mmvstatsd systemctl start pcp-mmvstatsd
# systemctl enable pcp-mmvstatsd # systemctl start pcp-mmvstatsdCopy to Clipboard Copied! Toggle word wrap Toggle overflow Enable the Satellite telemetry functionality.
Add the following lines to
/etc/foreman/settings.yamlconfiguration file:Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Schedule daily storage of metrics in archive files:
cat >/etc/cron.daily/refresh_mmv <<EOF #!/bin/bash echo "log mandatory on 1 minute mmv" | /usr/bin/pmlc -P EOF chmod +x /etc/cron.daily/refresh_mmv
# cat >/etc/cron.daily/refresh_mmv <<EOF #!/bin/bash echo "log mandatory on 1 minute mmv" | /usr/bin/pmlc -P EOF # chmod +x /etc/cron.daily/refresh_mmvCopy to Clipboard Copied! Toggle word wrap Toggle overflow Restart the Apache HTTP Server and PCP to begin data collection:
systemctl restart httpd pmcd pmlogger
# systemctl restart httpd pmcd pmloggerCopy to Clipboard Copied! Toggle word wrap Toggle overflow
3.2. Enabling Access to Metrics via the Web UI Copy linkLink copied to clipboard!
This procedure describes how to access metrics collected by PCP, via the web UI.
Procedure
Enable the Red Hat Enterprise Linux
optionalrepository:subscription-manager repos --enable rhel-7-server-optional-rpms
# subscription-manager repos --enable rhel-7-server-optional-rpmsCopy to Clipboard Copied! Toggle word wrap Toggle overflow Install the PCP web API and applications:
yum install pcp-webapi pcp-webapp-grafana pcp-webapp-vector
# yum install pcp-webapi pcp-webapp-grafana pcp-webapp-vectorCopy to Clipboard Copied! Toggle word wrap Toggle overflow Start and enable the PCP web service:
systemctl start pmwebd systemctl enable pmwebd
# systemctl start pmwebd # systemctl enable pmwebdCopy to Clipboard Copied! Toggle word wrap Toggle overflow Open firewall port to allow access to the PCP web service:
firewall-cmd --add-port=44323/tcp firewall-cmd --permanent --add-port=44323/tcp
# firewall-cmd --add-port=44323/tcp # firewall-cmd --permanent --add-port=44323/tcpCopy to Clipboard Copied! Toggle word wrap Toggle overflow
3.3. Verifying PCP Configuration Copy linkLink copied to clipboard!
To verify PCP is configured correctly, and services are active, run the following command:
pcp
# pcp
This outputs a summary of the active PCP configuration.
Example output from the pcp command:
In this example, both the Performance Metrics Collector Daemon (pmcd), and the Performance Metrics Web Daemon (pmwebd) services are running. It also confirms the PMDAs which are collecting metrics. Finally, it lists the currently actively archive file, in which pmlogger is storing metrics.