PMIECTL(1)
β¨ pmiectl π β the PMIECTL(1) glow-up β¨
okay bestie so this is the General Commands Manual page for pmiectl, and it's a whole vibe. buckle up π
β¨ SYNOPSIS β¨
pmiectl [-afmNV?] [-C check_args] [-c class] [-i ident] [-p policy]
command [host ...]
like, that's the whole incantation. type it, slay, move on π¦
πΈ DESCRIPTION πΈ
so pmiectl is the tool you use to manage and control non-primary instances of the Performance Co-Pilot (PCP) inference engine, aka pmie(1). this is highkey the most relevant thing ever if you're running a PCP inference engine βfarmβ β think a million pmie(1) instances all evaluating rules against performance data collected from pmcd(1) across a whole bunch of remote hosts. it's giving β¨distributed girlbosseryβ¨.
the primary pmie(1) instance is super tightly coupled to the local pmcd(1) process, and because of that it shares the same control infrastructure β namely systemd(1) or the PCP init(1) βrc scriptsβ. and that's exactly why the primary pmie(1) instance cannot be managed with pmiectl. nope. not it. π
ββοΈ
for brevity in everything below, the term βinstanceβ means a pmie(1) instance. we're keeping it cute and short, bestie.
okay so every single instance managed by pmiectl, pmie_check(1) and pmie_daily(1) has to follow these rules, no cap:
- each instance is fetching performance data from a single
pmcd(1)(so like, one host), but eachpmcd(1)may be providing performance data to zero, one or morepmie(1)processes running on one or more hosts. it's a whole many-to-many situation, very polyamorous of them π - on the local host, each
pmie(1)instance must be specified once in apmie_check(1)control file, andpmie(1)creates a unique log file, named in the 4th parameter of the associated control file entry (go read the CONFIGURATION section ofpmie_check(1), iykyk). - 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 (peep thesummarycommand below), the primarypmie(1)instance is automatically assigned to the special primary class. periodt.
each time you run pmiectl it manages one or more instances, updating the associated control files and then running pmie_check(1) to actually make the change happen. it's the middle manager of your pmie farm, honestly.
the host arguments π«Ά
the host arguments are usually just valid host names. but for all commands except create and cond-create (more on those below), the host arguments can also be egrep(1) regular expressions that match the whole of a valid host name β so the pattern actually used is ^host$. literally the whole name has to match, no partials.
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 combo of a class (from the optional -c option, or the default) plus the host arguments to each command is what identifies a target set of instances that the command operation gets applied to. that's the whole targeting system, bestie.
the -i option may be used with the create or cond-create commands to override the instance identity that's specified in the ident section of the class policy file (see the CLASS POLICY FILE section below). and since the identifier must be unique across all instances and all classes, it only makes sense to use this option when there's a single host argument. one host, one ident. that's the rule π
permissions tea β
given the tasks that pmiectl is undertaking, it usually must be run as root β the exceptions being the status command, or when the -N option is specified. so yeah, mostly root energy, but there are escape hatches, don't worry π
π COMMANDS π
command is one of the following, bestie. pick your fighter:
checkβ check the status of all currently configuredpmieinstances and restart any that have failed. if the-mflag is given onsystemd(1)platforms, it also migrates matching (and new) processes to thepmie_farmservice. it's the wellness check + glow-up combo π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 β either from theidentsection of the class policy file, or from ident given with 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/pmie/class.d/classname.
at least one host must be specified for the create command. no host, no create. non-negotiable β¨
cond-createβ similar tocreate, but the instance will only be created if one of the conditions in thecreatesection of the associated class policy file(s) evaluates totrue. it's the conditional queen of the command list π
if a -c option is specified, then only the class classname will be considered β otherwise all classes will be considered. in that 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).
if more than one class evaluates to true, then a composite pmie(1) configuration file is created, and the instance is also assigned to the special pmfind class. that composite configuration file may contain a mix of explicit configuration clauses and the more general conditional configuration clauses as understood by the pmieconf(1) tool. it's a whole blended family situation π¦
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 pmie(1) processes). like, please use -a, bestie, we're not trying to spawn chaos π
if an instance in the target set is already started, no change is made (see the restart command if you want 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 pmie(1) processes).
if an instance in the target set is already stopped, no change is made but a warning is issued. it's just letting you know, gently π«Ά
restartβ stop and then start the target set of instances. the classic off-and-on again, the relationship-crisis special π
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 pmie(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. and if there's no-coption specified and nohostarguments, i.e. the target set is empty, then all instances will be reported. it's the gossip session of commands, it tells you everything β¨destroyβ destroy the target set of instances. at the end of this operation the associatedpmie(1)processes will have been stopped and the relevant control file information removed. it's giving finale. π
if the target set intentionally contains more than one instance, then the-aoption should be used (this is designed to reduce the risk of accidentally terminating a potentially large number ofpmie(1)processes and removing theirpmie_check(1)configurations). this one really matters, bestie, please 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. yes, that's a force flag. yes, that's real power. use it responsibly π₯
π CLASS POLICY FILE π
ok bestie, so a class policy file is literally just a bunch of sections stacked together, and every section kicks off with a line that is simply the name of the section wrapped up in [ and ]. that's it, that's the whole opener.
Lines that start with a hash (#) are treated as comments and ignored. Blank or empty lines? also ignored, they're just vibing. β¨
The typical location of the policy file for the class foo is $PCP_SYSCONF_DIR/pmie/class.d/foo.
πΈ [class] πΈ
The optional class name section names the class. If it's missing, the name of the policy file (stripped of any directory prefix) is used as the name of the class. slay, the filename does the work for you.
π¦ [ident] π¦
The ident section specifies the template to be used for the instance identifier that gets given to each member of the class. This identifier needs to be unique across all instances and all classes, and it needs to be a valid file name in the local filesystem, so it would normally contain the class name and the macro %h, e.g. foo-%h. The macro is replaced by the host when each instance is created. no cap, uniqueness is not optional here.
π
[control] π
The control section consists of one or more lines of template text that will be used to create the control file for each instance. This must at least include the pmie_check(1) control line to specify how to start the associated pmie(1) process; this line contains fields separated by white space as follows:
- the hostname, usually the macro
%h nto indicate this is a non-primary instance- the "socks" flag, typically
n - the pathname used by
pmie(1)for the log file; this needs to be unique and is usually specified using thepmie_check(1)macroPCP_LOG_DIRas the start of the path, followed bypmie, and then the instance's unique directory%i, e.g.PCP_LOG_DIR/pmie/%i/pmie.log - additional parameters to
pmie(1)which probably include at least a-coption to provide a configuration file that describes which rules should be evaluated for instances of this class, which may be the same for all instances in this class, or it may include the%imacro to use a different configuration file for each instance. Note that if this configuration file does not exist, it will be created usingpmieconf(1)the first timepmie_check(1)is run.
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 this is missing, pmiectl will assume the version is 1.1 and insert the line when the instance is created. so it's got your back, but like, write it anyway bestie.
pmiectl will also add the class name during creation. e.g. $class=foo
Within a control line template, a simple form of parametric substitution is supported. The ENV(spec) macro is replaced by text using environment variables as follows:
- If
specis of the formvarthen 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
specis of the formvar:defaultthen if$varfrom the environment is defined and is not an empty string the value of$varis used, otherwise the valuedefaultis used. The substitution is simple, so any whitespace between the:and the)is included indefault, anddefaultcannot contain a). yeah, it's that literal about it.
As an example
# unset PMPROXY_PORT; PMPROXY_HOST=foobar.com pmiectl create ...
with a policy class control template line that includes
http://ENV(PMPROXY_HOST):ENV(PMPROXY_PORT:44322)
will generate a control line that includes
http://foobar.com:44322
β¨ [create] β¨
The create section defines the conditions that must be met before an instance will be created with the cond-create command. The intent is to allow different decisions to be made when a new host running pmcd(1) is discovered, e.g. by pmfind(1).
Each non-blank line in the create section is a condition of the form function(arg), where function is one of the following:
exists
arg is the name of a performance metric and exists evaluates to true if that metric exists in the Performance Metrics Name Space (PMNS) on the remote host.
values
arg is the name of a performance metric in the remote PMNS and values evaluates to true if some instance of that metric has a value on the remote host.
condition
arg is a derived metric expression in the format supported by pmRegisterDerived(3), and condition evaluates to true if the value of that expression on the remote host is greater than zero.
hostname
arg is a regular expression in the style of egrep(1) and hostname evaluates to true if the remote host name matches arg.
π [destroy] π
The destroy section defines the policy to be applied when an instance is destroyed.
The intent is to allow different decisions to be made when 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 the destroy section syntax and semantics is not yet defined. so like... it's giving placeholder energy, don't build your whole life on it.
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_LOG_DIR/pmie/%i/pmie.log -c foo-metrics.config
[create]
# matches all hosts
hostname(.*)
[destroy]
# still to be defined
π OPTIONS π
The available command line options are:
-a,--allβ Apply 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 whichpmie(1)instances belong to as class.-Ccheck_args,--checkargs=check_args β check_args are additional command line arguments forpmie_check(1)when it is called. This is most useful for options like-V. Multiple-Coptions may be used and the various check_args options will be accumulated and all passed topmie_check(1). stacking them? iconic.-f,--forceβ Force action if possible.-iident,--ident=ident β Override instance identifier with ident. This option applies only for the commandscreateandcond-create.-N,--showmeβ Runspmiectlin a "show me" or "dry run" mode where the intent of the command is shown, but no changes are made. perfect for the cautious girlies π«Ά-m,--migrateβ When used with thecreateorcheckcommands onsystemd(1)platforms, also migrate new or existing non-primarypmieprocesses to thepmie_farmservice. This is normally done automatically by thepmie_farm_checkservice, which is timer driven (so there may be a few minutes delay before automatic migration is initiated).-ppolicy,--policy=policy β Use policy as the class policy file. Defaults to$PCP_SYSCONF_DIR/pmie/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.
π 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), pmieconf(1), pmie(1), pmie_check(1), pmie_daily(1), systemd(1), PMAPI(3), pmDerivedRegister(3) and pcp.conf(5).
and that's the whole page bestie π this one ships from Performance Co-Pilot (PCP) as PMIECTL(1) β go forth and manage those pmie instances like the main character you are. periodt. β¨π
π¦ 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