PMLOGCTL(1)
π PMLOGCTL β manage and control Performance Co-Pilot archivers
okay bestie, buckle up, because this is the manual page for pmlogctl(1) β a General Commands Manual situation, and she is long but she is also iconic. let's get into it β¨
β¨ NAME β¨
pmlogctl β manage and control Performance Co-Pilot archivers π
πΈ SYNOPSIS πΈ
pmlogctl [-afmNV?] [-C check_args] [-c class] [-i ident] [-p policy]
command [host ...]
π¦ DESCRIPTION π¦
so, pmlogctl is the girl who manages the non-primary instances of the Performance Co-Pilot (PCP) archiver pmlogger(1). π«Ά like, this is the tool for a PCP archiver "farm" where you've got a whole squad of pmlogger(1) instances out there making archives of performance data collected from pmcd(1) on a bunch of remote hosts. it's giving β¨*farm energy*β¨
now, the primary pmlogger(1) instance? she's different. she's tightly linked to the local pmcd(1) process and therefore shares the same control infrastructure β namely systemd(1) or the PCP init(1) "rc scripts". and that is exactly why the primary pmlogger(1) instance cannot be managed with pmlogctl. she's got her own thing going on, and honestly, respect. π
for brevity in the description below, the term "instance" means a pmlogger(1) instance. periodt.
every instance managed by pmlogctl, pmlogger_check(1) and pmlogger_daily(1) abides by the following rules, no exceptions, no cap:
- each instance is fetching performance data from a single
pmcd(1)(i.e. one host), but eachpmcd(1)may be providing performance data to zero, one or morepmlogger(1)processes running on one or more hosts. sharing is caring fr fr π - on the local host, each
pmlogger(1)instance must be specified once in apmlogger_check(1)control file, andpmlogger(1)creates archives in a unique directory, named in the 4th parameter of the associated control file entry (go peek at the CONFIGURATION section ofpmlogger_check(1)for the deets). - each instance belongs to exactly one class, optionally named using a
$class=...assignment in the associated control file. the special default class is reserved for all instances that don't have an associated$class=...assignment. and for reporting purposes (refer to thesummarycommand below π), the primarypmlogger(1)instance is automatically assigned to the special primary class. queen behavior, honestly. π
each pmlogctl execution manages one or more instances, updating the associated control files and then running pmlogger_check(1) to effect the desired change.
the host arguments are usually valid host names. for all commands except create and cond-create (described below), the host arguments may also be egrep(1) regular expressions that match the whole of a valid host name β so the pattern used is actually ^host$. for example:
foo.*β matches all host names beginning with "foo".*fooβ matches all host names ending with "foo".*[fF][oO][oO].*β matches all host names containing "foo" in upper, lower or mixed case π₯
the combination of a class from the optional -c option (or default) and the host arguments to each command identifies a target set of instances to which the command operation should be applied.
the -i option may be used with the create or cond-create commands to override the instance identity that is specified in the ident section of the class policy file (see the CLASS POLICY FILE section below). since the identifier must be unique across all instances and all classes, it only makes sense to use this option when there is a single host argument. no multitasking on that one bestie π
given the tasks that pmlogctl is undertaking, it usually must be run as "root" β the exceptions being the status command, or when the -N option is specified. yes she's high maintenance, but she's worth it π
π COMMANDS π
command is one of the following:
checkβ check the status of all currently configuredpmloggerinstances and restart any that have failed. if the-mflag is given onsystemd(1)platforms, also migrate matching (and new) processes to thepmlogger_farmservice. vibe check + glow up in one step β¨createβ create new instances in the class classname (defaultby default) for the host hosts. the name of the class is used to identify a class policy file (see the CLASS POLICY FILE section below) which provides a template for each new control file, with%hreplaced by host and%ireplaced by the instance's (unique) identifier from the ident section of the class policy file, or ident from the-ioption.
the -p option may be used to identify a class policy file other than the one found in the standard place, i.e. $PCP_SYSCONF_DIR/pmlogger/class.d/classname.
at least one host must be specified for the create command. don't come to the function empty-handed π
cond-createβ similar tocreate, but the instance will only be created if one of the conditions in the create section of associated class policy file(s) evaluates totrue. conditional queen π
if a -c option is specified, then only the class classname will be considered, otherwise all classes will be considered. in the latter case, if none of the conditions in any of the classes evaluates to true, then the special pmfind class is used (this is the "default" class for the cond-create command when all else fails β she's the backup bestie who always shows up).
if more than one class evaluates to true then a composite pmlogger(1) configuration file is created and the instance is also assigned to the special pmfind class. the composite configuration file may contain a mix of explicit configuration clauses and the more general conditional configuration clauses as understood by the pmlogconf(1) tool.
startβ start the target set of instances. π
if the target set intentionally contains more than one instance, then the -a option should be used β this is designed to reduce the risk of accidentally starting a potentially large number of pmlogger(1) processes. (we do not do accidental chaos in this house π)
if an instance in the target set is already started, no change is made (see the restart command to force new instances to be launched).
stopβ stop the target set of instances. π
if the target set intentionally contains more than one instance, then the -a option should be used β this is designed to reduce the risk of accidentally stopping a potentially large number of pmlogger(1) processes.
if an instance in the target set is already stopped, no change is made but a warning is issued. noted. π
restartβ stop and then start the target set of instances. π
if the target set intentionally contains more than one instance, then the -a option should be used β this is designed to reduce the risk of accidentally stopping and starting a potentially large number of pmlogger(1) processes.
if an instance in the target set is already stopped, a warning is issued before the instance is started.
statusβ report the status of the target set of instances. if there is no-coption specified and no host arguments, i.e. the target set is empty, then all instances will be reported. spill the tea on everyone π΅destroyβ destroy the target set of instances. at the end of this operation the associatedpmlogger(1)processes will have been stopped and the relevant control file information removed. πβ¨
if the target set intentionally contains more than one instance, then the -a option should be used β this is designed to reduce the risk of accidentally terminating a potentially large number of pmlogger(1) processes and removing their pmlogger_check(1) configurations. seriously bestie, use -a. π
the policy file linked to the class of an instance to be destroyed may contain a destroy section that may influence if and how the destroy operation should be performed. this may require a -p option to find the associated class policy file.
the class policy checking can be by-passed using the -f (force) command line option. β οΈ by-passed, like, skipping the line entirely β dramatic and powerful, use responsibly.
π CLASS POLICY FILE π
Okay bestie, this is the part where we talk about the policy file itself, and honestly? It's giving "structured and iconic." A class policy file is made of a bunch of sections, and every section kicks off with a line that just starts with the name of the section wrapped in [ and ]. Simple. Clean. We love.
Lines that start with a hash (#) are comments and get ignored. Blank or empty lines? Also ignored. No notes. π«Ά
The typical hangout spot for the policy file of the class foo is:
$PCP_SYSCONF_DIR/pmlogger/class.d/foo
[class]β this section is optional and it names the class. If you don't include it, the name of the policy file (with any directory prefix stripped off) becomes the name of the class. So it figures it out itself, main character energy π[ident]β this one sets the template used for the instance identifier handed to every member of the class. Heads up: this identifier has to be unique across all instances and all classes, and it also needs to be a valid file name on the local filesystem. So yeah, it'd normally contain the class name plus the macro%h, likefoo-%h. That macro gets swapped out for the host when each instance is created. β¨[control]β this section is one or more lines of template text that get used to build the control file for each instance. It has to at least include thepmlogger_check(1)control line that says how to start the associatedpmlogger(1)process. That line has fields separated by white space, like this:- the hostname, usually the macro
%h nto indicate this is a non-primary instance- the ``socks'' flag, typically
n - the directory where the
pmlogger(1)archives will be created; this needs to be unique and is usually written using thepmlogger_check(1)macroPCP_ARCHIVE_DIRas the start of the path, followed by the instance identifier, usually the macro%i, e.g.PCP_ARCHIVE_DIR/%i - additional parameters to
pmlogger(1), which probably include at least a-coption pointing at a configuration file that describes which metrics should be logged for instances of this class. That config can be the same for every instance in the class, or it can include the%imacro so each instance gets its own configuration file. Quick note: if that configuration file doesn't exist, it will be created usingpmlogconf(1)the first timepmlogger_check(1)is run. π
- the hostname, usually the macro
Before the control line, there should be a line that defines the version of the control line that follows, i.e.
$version=1.1
If that's missing, pmlogctl will assume the version is 1.1 and insert the line when the instance is created.
pmlogctl will also add the class name during creation. e.g.
$class=foo
Inside a control line template, there's a simple form of parametric substitution supported. The ENV(spec) macro gets replaced by text using environment variables, like this:
- If spec is of the form
varthen the value of$varfrom the environment is used. If$varis not defined or has the value of an empty string, this is an error. - If spec is of the form
var:defaultthen if$varfrom the environment is defined and is not an empty string the value of$varis used, otherwise the value default is used. The substitution is simple, so any whitespace between the:and the)is included in default, and default cannot contain a). (noted, don't do that π)
As an example, take
# unset PMPROXY_PORT; PMPROXY_HOST=foobar.com pmlogctl create ...
with a policy class control template line that includes
http://ENV(PMPROXY_HOST):ENV(PMPROXY_PORT:44322)
and it will generate a control line that includes
http://foobar.com:44322
see? ate that. π₯
[create]β this section defines the conditions that must be met before an instance will be created with thecond-createcommand. The whole intent here is to let different decisions be made when a new host runningpmcd(1)gets discovered, e.g. bypmfind(1).
Every non-blank line in the create section is a condition of the form function(arg), where function is one of these:
existsβ arg is the name of a performance metric andexistsevaluates to true if that metric exists in the Performance Metrics Name Space (PMNS) on the remote hostvaluesβ arg is the name of a performance metric in the remote PMNS andvaluesevaluates to true if some instance of that metric has a value on the remote hostconditionβ arg is a derived metric expression in the format supported bypmRegisterDerived(3), andconditionevaluates to true if the value of that expression on the remote host is greater than zerohostnameβ arg is a regular expression in the style ofegrep(1)andhostnameevaluates to true if the remote host name matches arg
[destroy]β this section defines the policy to apply when an instance is destroyed. The intent is to let different decisions be made when a discovery service, e.g.pmfind(1), notices that a host associated with an instance is no longer present. But in the current version this is not implemented and thedestroysection syntax and semantics is not yet defined. So like... don't come for it, it's a work in progress π
A sample class policy file is as follows:
# policy file for the foo class
[class]
foo
[ident]
foo-%h
[control]
$version=1.1
%h n n PCP_ARCHIVE_DIR/%i -c foo-metrics.config
[create]
# matches all hosts
hostname(.*)
[destroy]
# still to be defined
β¨ OPTIONS β¨
Here are all the command line options available to you, bestie. Pick your faves π
-a,--allβ apply the action to all matching instances. By default only one instance definition is expected and acted upon.-cclass,--class=class β set the name of the class for whichpmlogger(1)instances belong to as class.-Ccheck_args,--checkargs=check_args β check_args are additional command line arguments forpmlogger_check(1)when it is called. This is most useful for options like-V. You can use multiple-Coptions and the various check_args options will be accumulated and all passed topmlogger_check(1).-f,--forceβ force the action if possible. πͺ-iident,--ident=ident β override the instance identifier with ident. This option applies only for the commandscreateandcond-create.-N,--showmeβ runspmlogctlin ashow me'' ordry run'' mode where the intent of the command is shown, but no changes are made. perfect for when you're just window shopping ποΈ-m,--migrateβ when used with thecreateorcheckcommands onsystemd(1)platforms, also migrate new or existing non-primarypmloggerprocesses to thepmlogger_farmservice. This is normally done automatically by thepmlogger_farm_checkservice, which is timer driven (so there may be a few minutes delay before automatic migration is initiated). patience, babes β³-ppolicy,--policy=policy β use policy as the class policy file. Defaults to$PCP_SYSCONF_DIR/pmlogger/class.d/<class>.-V,--verboseβ enable verbose mode. Using this option twice increases verbosity. Verbose output is written tostderr.-?,--helpβ display usage message and exit. the classic. π
π 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).
π SEE ALSO π
egrep(1), init(1), PCPIntro(1), pmcd(1), pmlc(1), pmlogconf(1), pmlogger(1), pmlogger_check(1), pmlogger_daily(1), systemd(1), PMAPI(3), pmDerivedRegister(3) and pcp.conf(5).
go read them, they're all besties with this one fr fr π«Ά
and that's the whole page, babe π this came out of the Performance Co-Pilot source, version PCP, and it's filed under PMLOGCTL(1) with its own little date stamp up top. slay, thanks for reading, 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.0.1-1.fc43 Β· 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.1.0-6.fc44 Β· 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) 2020 Ken McDonell. All Rights Reserved
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms