PMLOGGER.CONTROL(5)
π NAME π
pmlogger.control β the control files for Performance Co-Pilot archiving. This is section 5 of the File Formats Manual, bestie, so buckle up π
π¦ DESCRIPTION π¦
So, historical archiving of performance data for Performance Co-Pilot (peep PCPIntro(1)) uses pmlogger(1), and like, one or more instances of pmlogger may be managed by pmlogger_check(1) and pmlogger_daily(1). The way this whole little ecosystem vibes together? Iconic. β¨
pmlogger_check(1) can be run at any time of the day, and its whole job is checking that the desired set of pmlogger processes are actually running. If they're not? It (re-)starts any missing logger processes, no big deal. By default, pmlogger_check(1) also calls pmlogger_daily(1) with a -K option to execute any required archive compression tasks. π
pmlogger_daily(1) is meant to be run once per day, preferably in the early morning, as soon after midnight as practicable. Its task is to aggregate, rotate and perform general housekeeping for one or more sets of PCP archives. She's the main character of your cron schedule, fr fr. π
Both pmlogger_check(1) and pmlogger_daily(1) operate on a family of shared control files, namely the $PCP_PMLOGGERCONTROL_PATH file and files within the $PCP_PMLOGGERCONTROL_PATH.d directory. These files must not be writable by any user other than root. That's not a suggestion, that's the law. π
The control file(s) should be customized according to the following rules that define for the current version (1.1) of the control file format. Let's go through them one by one, bestie:
- Lines beginning with a
#'' are comments. A special case is lines beginning#!#''; these are control lines for apmloggerthat has been stopped usingpmlogctl(1). - Lines beginning with a
$'' are assumed to be assignments to environment variables in the style of `sh(1)`, and all text following the$'' will beeval'ed by the script reading the control file, and the corresponding variable exported into the environment. This is particularly useful to set and export variables into the environment of the administrative scripts, e.g.
$ PMCD_CONNECT_TIMEOUT=20
If the value to the right of the ``='' contains any white space, then the value should be enclosed in double (") or single (') quotes.
As the lines in each control file are processed in order, it is important that any environment variables should be set before a control line that specifies a pmlogger instance that might expect to use those environment variables, e.g. to control compression or culling of archives by pmlogger_daily(1). Order matters, periodt.
- There should be a version line in the control file of the form:
$version=1.1
But since the only version currently supported is 1.1, this declaration provides no additional value beyond documentation. It's giving decorative, honestly. π
- Fields within a line of the control file(s) are usually separated by one or more spaces or tabs (although refer to the description of the directory field below for some important exceptions). π
- There should be one line in the control file(s) for each
pmloggerinstance with at least 4 fields of the form:
host primary socks directory args ...
- The host field is the name of the host that is the source of the performance metrics for this
pmloggerinstance. The reserved wordLOCALHOSTNAMEwill be replaced bylocal:(so connection topmcd(1)on the local host). Cute shorthand, love that for us. π - The primary field indicates if this is a primary
pmloggerinstance (y) or not (n). Since the primary logger must run on the local host, and there may be at most one primary logger for a particular host, this field can beyfor at most onepmloggerinstance, in which case the host name must be the name of the local host (orLOCALHOSTNAME). One primary only β no fighting over the crown, girls. π - The socks field indicates if this
pmloggerinstance needs to be started under the control ofpmsocks(1)to connect to apmcd(1)through a firewall (yorn). Firewall traversal era π§ - The directory field is a directory name. All archive files associated with this
pmloggerinstance will be created in this directory, and this will be the current directory for the execution of any programs required to maintain those archives. A useful convention is that primary logger archives for the local host with hostnamemyhostare maintained in the directory$PCP_ARCHIVE_DIR/myhost(this is where the defaultpmloggerstart-up script in$PCP_RC_DIR/pmloggerwill create the archives), while archives for the remote hostmumbleare maintained in$PCP_ARCHIVE_DIR/mumble. Organised queen behavior π - The directory field may contain embedded shell syntax that will be evaluated by
sh(1)to produce the real directory name to be used. The allowed constructs are:- Any text (including white space) enclosed with
$(and)will be interpreted as a shell command. - Any text (including white space) enclosed with
`and`(back quotes) will be interpreted as a shell command. - Within a single line only one style of embedded shell command is allowed, so either
$(...)or`...`, but not both. - An initial double quote (") followed by arbitrary text (including white space, but excluding an embedded double quote) and a final double quote.
- An initial single quote (') followed by arbitrary text (including white space, but excluding an embedded single quote) and a final single quote.
- Any word containing a
$(assumed to introduce an environment variable name).
- Any text (including white space) enclosed with
- In the directory field, the reserved word
LOCALHOSTNAMEwill be replaced by the name of the local host. Similarly the reserved wordsPCP_ARCHIVE_DIRandPCP_LOG_DIRappearing anywhere in the directory field will be replaced by the values of the corresponding environment variables. Substitution slay β¨ - If the directory field (after any shell substitution) begins with
+'' then this indicates that `pmlogger(1)` will be executed with a `-R` option in *args* topush'' the archive to a remotepmproxy(1)server. In this case, no archive files are stored locally, but directory (after the leading ``+'' is stripped) is used as the directory in which the log file from the localpmlogger(1)will be stored and possibly the location for thepmlogger(1)configuration file (see the example below). Remote push era π - The optional args field and any remaining fields are interpreted as arguments to be passed to
pmlogger(1). Most typically this would be at least the-coption to specify the metrics to be logged and the logging frequencies, and/or-Rin the case of a ``push'' archive.
The following sample control lines specify a primary logger on the local host (bozo), non-primary loggers to collect and log performance metrics from the hosts wobbly, boing and the local host (i.e. bozo) and a logger pushing archives to the remote pmproxy(1) on the host grunt. Look at her, she's doing so much π«Ά
$version=1.1
bozo y n $PCP_ARCHIVE_DIR/bozo -c config.default
wobbly n n "/store/wobbly/$(date +%Y)" -c ./wobbly.config
boing n n $PCP_ARCHIVE_DIR/boing -c ./pmlogger.config
LOCALHOSTNAME n n /cluster/LOCALHOSTNAME -c ./precious.config
LOCALHOSTNAME n n +PCP_ARCHIVE_DIR/remote -R http://grunt:44322 \
-c ./remote.config
πΈ SCHEDULED EXECUTION πΈ
The periodic execution of pmlogger_check(1) and pmlogger_daily(1) is controlled by either systemd(1) or cron(8). Pick your fighter β
Typical crontab(5) entries are provided in $PCP_SYSCONF_DIR/pmlogger/crontab (unless installed by default in /etc/cron.d already) and shown below.
# daily processing of archives
14 0 * * * $PCP_BINADM_DIR/pmlogger_daily
# every 30 minutes, check pmlogger instances are running
25,55 * * * * $PCP_BINADM_DIR/pmlogger_check
When using systemd(1) on Linux, no crontab entries are needed as the timer mechanism provided by systemd is used instead to achieve the same period execution as the crontab example above. Same energy, different plumbing π
π FILES π
$PCP_PMLOGGERCONTROL_PATHβ the PCP logger control file. For a new installation this file contains nopmlogger(1)control lines (the real control files are all in the$PCP_PMLOGGERCONTROL_PATH.ddirectory), but this file is still processed to support any legacy configurations therein from earlier PCP releases.
β οΈ Warning: this file must not be writable by any user other than root.
$PCP_PMLOGGERCONTROL_PATH.dβ optional directory containing additional PCP logger control files, with one or more perpmloggerspecification per file.
β οΈ Warning: the files herein must not be writable by any user other than root.
$PCP_SYSCONF_DIR/pmlogger/crontabβ sample crontab for automated script execution by$PCP_USER(orroot). Exists only if the platform does not support the/etc/cron.dmechanism.
π§ PCP ENVIRONMENT π§
Environment variables with the prefix PCP_ are used to parameterize the file and directory names used by PCP. On each installation, the file /etc/pcp.conf contains the local values for these variables. The $PCP_CONF variable may be used to specify an alternative configuration file, as described in pcp.conf(5). Env var girly through and through π
π₯ SEE ALSO π₯
PCPIntro(1), pmcd(1), pmlogctl(1), pmlogger(1), pmlogger_check(1), pmlogger_daily(1), pmlogger_daily_report(1), pmproxy(1), pmsocks(1), systemd(1) and cron(8). The whole friend group, all linked up π«Ά
And that's the whole page, bestie! This was brought to you by Performance Co-Pilot (that's the source, and PCP is the version tag riding along with it) β PMLOGGER.CONTROL(5), File Formats Manual. Go forth and archive responsibly, mwah π
π¦ where this page comes from
- arch rolling: pcp 7.2.2-2 Β· GPL-2.0-or-later AND LGPL-2.1-or-later AND CC-BY-3.0
- centos-stream 10: pcp-doc 7.1.5-6.el10 Β· GPL-2.0-or-later AND CC-BY-3.0
- fedora 43: pcp-doc 7.2.1-1.fc43
- fedora 43: pcp-doc 7.2.2-1.fc43
- fedora 43: pcp-doc 7.2.2-2.fc43 Β· GPL-2.0-or-later AND CC-BY-3.0
- fedora 44: pcp-doc 7.2.1-1.fc44
- fedora 44: pcp-doc 7.2.2-1.fc44
- fedora 44: pcp-doc 7.2.2-2.fc44 Β· GPL-2.0-or-later AND CC-BY-3.0
- ubuntu resolute: pcp 7.1.1-1
- ubuntu stonking: pcp 7.2.1-2build1
- Copyright (c) 2013-2019 Red Hat
- Copyright (c) 2000 Silicon Graphics, Inc. All Rights Reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms