PMLC(1)
PMLC(1) π General Commands Manual π
okay bestie, welcome to pmlc, section 1 of the general commands manual. this is the girl who talks to your pmloggers. yes, all of them. pull up a chair. π«Ά
β¨ NAME β¨
pmlc β configure active Performance Co-Pilot pmlogger(s) interactively π
πΈ SYNOPSIS πΈ
pmlc [-eiPz?] [-D debug] [-h host] [-n pmnsfile] [-p port] [-Z timezone] [pid]
π¦ DESCRIPTION π¦
so here's the vibe: pmlc is how you change which metrics and instances a pmlogger(1) writes into a Performance Co-Pilot archive (peep PCPIntro(1) for the lore). you can also change how often the metrics get collected, and whether logging is mandatory, advisory, on or off. it also just, like, tells you the current logging status of metrics and instances. no cap.
and the best part? pmlc can control pmlogger instances on remote hosts as well as the ones chillin' on your local host. main character energy across the network, fr fr. β¨
normally pmlc operates on the distributed Performance Metrics Name Space (PMNS), but if you specify the -n option, an alternative local PMNS gets loaded from the file pmnsfile. iconic.
if the -P option is specified, pmlc will attempt to start with a connection to the primary pmlogger on the local host. if the -p option is specified, then pmlc will attempt to start with a connection to the pmlogger on this TCP/IP port. alternatively, if pid is specified, a connection to the pmlogger instance with that process id will be attempted on startup. the -h option may only be used if -P, -p port or a pid is also specified. in that case pmlc will initially connect to the specified (remote) pmlogger instance on host rather than the local host. and if the connection to the specified pmlogger instance cannot be established, pmlc will start with no connection. (she said "i'll be there" and then ghosted. it happens. π)
these options typically allow the same file of pmlc commands to be directed to multiple pmlogger instances by varying the command line arguments. β¨
heads up bestie:-P,-pport, pid and-hare used only when making an initial connection to a pmlogger instance. they are not used as defaults if subsequent connections are made interactively (see theconnectcommand below). don't get caught lacking.
by default, pmlc reports the time of day according to the local timezone on the system where pmlc is run. the -Z option changes the timezone to timezone in the format of the environment variable TZ as described in environ(7). the -z option changes the timezone to the timezone of the pmlogger instance from which information is being obtained. only one of -z or -Z may be specified. pick a lane, babe. π
if standard input is from a tty, pmlc is interactive, with prompts. the -i flag may be used to force interactive behavior, and is typically used in conjunction with -e to echo all command input on standard output. π
π COMMANDS π
the following commands may be used:
show [ loggers ] [ @host ]β displays the process identities of all pmlogger instances running on the local host (or host, if specified). the primary pmlogger pid is parenthesized because it can be referred to as"primary"as well as by its pid. so cute, she has two names. πconnect pid [ @host ]connect primary [ @host ]β connectspmlcto the specified pmlogger process. any existing connection to a pmlogger instance is closed first. each pmlogger instance will accept at most one connection at a time, so if the connection is successfully established, yourpmlcwill be the only one controlling the pmlogger instance it is connected to. exclusive. possessive. iconic. π₯new volumeβ this command works only while a connection to a pmlogger instance is established. it tells the pmlogger to close the current volume of the archive and open a new volume. closed volumes may be compressed and/or moved to a remote system, remote storage or off-line storage, e.g. as part of a regular archive management procedure to control the size of the physical archive files on the system where pmlogger is running. spring cleaning, but for archives. π§statusβ this command works only while a connection to a pmlogger instance is established. it prints information about the state of the pmlogger instance and its associated archive.timezone local | logger | "timezone"β this command sets the time zone used when times are printed.localmeans use the time zone of the machine thatpmlcis running on.loggermeans use the time zone of the machine where the pmlogger instance is running. alternatively an explicit timezone enclosed in quotes may be supplied (refer toTZinenviron(7)for details). the default time zone islocalunless one of the-zor-Zoptions has been supplied on the command line.flushβ this command works only while a connection to a pmlogger instance is established, and requests the pmlogger instance to flush to disk all buffers associated with the current archive. for old-timers,syncis a synonym forflush. in current versions ofpmlogger(1)all writes are unbuffered and aligned with the logical records in the external files, so this command achieves nothing, but is retained for backwards compatibility. she's still here, she's just not doing anything. πdisconnectβ disconnectpmlcfrom the current pmlogger instance, if any.sleep delayβ pausepmlcfor delay milliseconds. this may be helpful in scripted uses ofpmlcto allow the current pmlogger instance to make progress on recent requests before interrogating the status. let her cook. πhelpβ displays a summary of the available commands.hand?are synonyms forhelp.quitβ exits frompmlc. bye bestie π
the remaining commands query and change the logging state of metrics and instances. they will work only if pmlc has a connection to a pmlogger instance. metrics may be specified as fully qualified names (e.g. hinv.ncpu) or subtrees of the PMNS (e.g. hinv) which are expanded to include all metrics in the subtree (e.g. hinv.ncpu, hinv.cpuclock, etc.). lists of metrics may be specified by enclosing them in braces with spaces or a comma between metrics (e.g. {hinv.ncpu hinv.ndisk}). subtrees of metrics may be included in such lists.
each individual metric specification may be further qualified with a space or comma separated list of instances in square brackets (e.g. kernel.all.load["1 minute", "5 minute"]). external instance names or numeric internal instance identifiers or both may be used in the same list (e.g. sample.colour.[red,1,"blue"]). if an instance qualification is applied to a subtree of the PMNS all of the metrics in the subtree must have the same instance domain. instance qualifications may not be applied to entire lists of metrics but may appear inside such lists.
if no instances are specified for a metric, all instances are used. "all instances" means all instances available at the time the pmlogger instance in question fetches the metrics for logging. if an instance domain changes over time this is not always the same as the set of instances displayed by pmlc, which can only display the currently available instances. to prevent unintentional errors, only the instances that are currently available to pmlc may appear in instance specifications. π
query metriclistβ the current logging state of each metric (and instances, where applicable) in metriclist is displayed. this includes the logging state (e.g.on,maybe,off) and the logging interval for each metric (and instance) requested. the following abbreviations pertaining to metrics (and instances) may appear in the output:adv, advisory;mand, mandatory;nl, not logged (not in the archive);na, in the archive but not currently available from its Performance Metrics Domain Agent (PMDA). where appropriate, an instance name will appear last on a line preceded by its numeric internal instance identifier.[ log ] mandatory on interval metriclistβ this form of thelogcommand turns on logging for the metrics (and any instances) in metriclist. interval specifies how often the specified metrics/instances should be logged.onceindicates that the metrics/instances should appear at most once in the archive. more often one would use the optional keywordeveryfollowed by a positive number and one ofmillisecond(ormsec),second(orsec),minute(ormin),houror their plurals. note that the keyworddefaultwhich may be used for the default interval in apmlogger(1)configuration file cannot be used inpmlc. internal limitations require the interval to be less than (approximately) 74 hours. an interval value of zero is a synonym foronce.[ log ] mandatory off metriclistβ this tells the pmlogger instance not to archive any of the metrics/instances in metriclist.[ log ] mandatory maybe metriclistβ this tells the pmlogger instance to honor any subsequent advisory logging requests for the metrics/instances in metriclist. if the current logging state of the metrics/instances is mandatory (eitheronoroff) the new state will be set tomaybe(effectively advisory off). if the current state of the metrics/instances is already advisory (eitheronoroff) the state(s) for the metrics/instances will remain as they are.[ log ] advisory on interval metriclist[ log ] advisory off metriclistβ advisory logging is only applicable if the last logging state specified for a metric/instance was"mandatory maybe"(which permits subsequent advisory logging control) or if the logging state is already advisory. these two statements turn advisory logging on or off (respectively) for the specified metrics/instances. the interpretation for interval is as above for the mandatory case.
there is no continuation character required for commands that span lines. just keep typing, she gets it. β¨
the word at may be used interchangeably with @. π
a request to archive all instances of a metric will supersede any prior request to log either all or specific instances of a metric (if the request specifies a permissible transition in the logging state). a request to archive specific instances of a metric when all instances of a metric are already being logged is refused by pmlogger. she said no. periodt. π
π OPTIONS π
the available command line options are:
-e,--echoβ echo all command input on standard output.-hhost,--host=host β connect pmlogger on host, rather than on the default localhost.-i,--interactiveβ force interactive behavior.-npmnsfile,--namespace=pmnsfile β load an alternative Performance Metrics Name Space (PMNS(5)) from the file pmnsfile.-pport,--port=port β connect to the primary pmlogger on TCP/IP port port.-P,--primaryβ connect to the primary pmlogger.-z,--logzoneβ use local time of the pmlogger as the reporting timezone.-Ztimezone,--timezone=timezone β use timezone for the date and time. Timezone is in the format of the environment variableTZas described inenviron(7).-?,--helpβ display usage message and exit.
okay that's the whole vibe so far β but wait, there's more of this page coming, don't go anywhere bestie π«Ά
π ACCESS CONTROL π
Okay bestie, so pmlc might have restricted access to and control over pmlogger(1) processes. It's giving β¨boundariesβ¨, and honestly? Respect.
If a pmlogger(1) can't export its control information to the local pmcd(1), then that pmlogger(1) cannot be connected to nor controlled by pmlc. In practice this means the pmlogger(1) process has to be owned by the user pcp and/or the group pcp. That's the vibe check it has to pass, no exceptions π«Ά.
If pmlogger(1) is running on the host foo, then use
pminfo -f -h foo pmcd.pmlogger
to verify that the pmlogger(1) of interest is known to pmcd(1). Alternatively: pmlogger(1) instances that are not reported from the pmlc show loggers @foo command are not known to pmcd(1) on the host foo. iykyk π
If pmlogger(1) is launched with a configuration file that contains an [access] section, then pmlc will be unable to connect to that pmlogger(1) unless the access controls allow some access from the host where pmlc is being run. Minimally this requires the enquire access to be permitted in the pmlogger(1) access control section. Bare minimum, babe. π
If pmlc is able to connect to the pmlogger(1) of interest, then here's the tea β β the permissions you need for each pmlc command:
show loggersβ requiredpmloggeraccess: Anyconnectβ requiredpmloggeraccess: Any ofenquire,advisoryormandatorystatusβ requiredpmloggeraccess: Any ofenquire,advisoryormandatoryquery ...β requiredpmloggeraccess: Any ofenquire,advisoryormandatorydisconnectβ requiredpmloggeraccess: Anylog advisory ...β requiredpmloggeraccess:advisorylog mandatory ...β requiredpmloggeraccess:mandatorynew volumeβ requiredpmloggeraccess:mandatory
π¨ CAVEATS π¨
Not me having to warn you about this, but here we are π.
If all instances of a metric are being logged and a request is made to log specific instances of the metric with the same state and frequency, the request may appear to succeed, even though pmlogger has refused the request. This is not normally a problem, as the required information will still be placed into the archive by pmlogger. Fake it till you make it, I guess π.
However β and this is the plot twist π β in the case where the metric is to be logged once, the outcome is not what might be expected. When pmlogger receives a request to archive a metric once, it places the current value(s) of the metric into the archive as soon as it can, regardless of whether the metric is already in the archive. This may be used to force values into the archive. When a request to archive specific instances of a metric arrives and is refused because all instances of the metric are already being logged, pmlogger does not place values for the instances requested into the archive. It returns the current logging state for each instance requested to pmlc. The requested and returned states are identical, so pmlc doesn't raise an error as it should. It's giving "everything's fine" while everything is not fine π.
To ensure that only certain instances of a metric are being logged, one should always turn off logging for all instances of the metric prior to turning on logging for the specific instances required. Write that down bestie π
π©Ί DIAGNOSTICS π©Ί
Most error or warning messages are self-explanatory, lowkey iconic of them. A message of the form
Warning: unable to change logging state for...
followed by a list of metrics (and possibly instances) indicates that pmlogger refused the request for the metrics (and instances) that appear. Any metrics (and instances) that were specified but do not appear in the message have had their logging state updated successfully β no news is good news, bestie πΈ. Usually this warning results from requesting advisory logging when a mandatory control is already in place, or requesting logging for specific instances when all instances are already being logged. Classic overlap drama π
.
π ENVIRONMENT π
If the PMLOGGER_REQUEST_TIMEOUT environment variable is not set or set to 0 (zero), then pmlc will block until a connection is established with pmlogger(1) on the requested port. Just sitting there. Waiting. Patient queen π.
If PMLOGGER_REQUEST_TIMEOUT is set to a value greater than zero, then pmlc will fail with an error after that many seconds if a connection isn't established. This may be used by administrative scripts such as pmlogger_daily(1) to poll pmlogger when it is starting up until it is ready and listening on its control port. β¨Patience with a deadlineβ¨, we love to see it.
π§ 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). So many knobs, so little time π.
π DEBUGGING OPTIONS π
The -D or --debug option enables the output of additional diagnostics on stderr to help triage problems, although the information is sometimes cryptic and primarily intended to provide guidance for developers rather than for end-users. Fair warning, it's giving lore you weren't supposed to read π. debug is a comma separated list of debugging options; use pmdbg(1) with the -l option to obtain a list of the available debugging options and their meaning.
Debugging options specific to pmlc are as follows:
appl0β dump metrics and instances receivedappl1β dump state after each command is parsed
π SEE ALSO π
PCPIntro(1), pmcd(1), pmlogdump(1), pmlogger(1), pcp.conf(5), pcp.env(5), PMNS(5) and environ(7).
And that's a wrap on the PMLC(1) page, bestie!! π«Άβ¨ This one came to you courtesy of Performance Co-Pilot β that's the PCP source and version, fr fr β and it's the PMLC(1) page, dated as shown in the original footer. Go forth and control your loggers responsibly ππΈπ¦
π¦ 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
- 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 stonking: pcp 7.2.1-2build1
- 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