PCP2XML(1)
β¨ NAME β¨
pcp2xml β the pcp-to-xml metrics exporter, bestie π
πΈ SYNOPSIS πΈ
pcp2xml [-5CGHIjLmnrRvVxXz?] [-4 action] [-8|-9 limit] [-a archive] [-A
align] [--archive-folio folio] [-b|-B space-scale] [-c config]
[--container container] [-D debug] [--daemonize] [-e derived] [-f
format] [-F outfile] [-h host] [-i instances] [-J rank] [-K spec] [-N
predicate] [-O origin] [-P|-0 precision] [-q|-Q count-scale] [-s
samples] [-S starttime] [-t interval] [-T endtime] [-y|-Y time-scale]
[-Z timezone] metricspec [...]
π¦ DESCRIPTION π¦
okay so. pcp2xml is a customizable performance metrics exporter tool that takes PCP stuff and turns it into XML. so iconic. Any available performance metric β live or archived, system and/or application β can be picked for exporting, either with command line arguments or with a configuration file. your choice, no cap π
pcp2xml is a close relative of pmrep(1). (like, siblings fr fr π«Ά) So go read pmrep(1) for the metricspec description that pcp2xml accepts on the command line. And peep pmrep.conf(5) for the description of the pcp2xml.conf configuration file syntax. This page right here describes the pcp2xml-specific options and the configuration file differences versus pmrep.conf(5). Also pmrep(1) lists some usage examples, and most of those are applicable with pcp2xml as well. slay β¨
Only the command line options listed on this page are supported β other options available for pmrep(1) are not supported. periodt.
Options via environment values (see pmGetOptions(3)) override the corresponding built-in default values (if any). Configuration file options override the corresponding environment variables (if any). Command line options override the corresponding configuration file options (if any). It's giving hierarchy π
π CONFIGURATION FILE π
pcp2xml uses a configuration file with syntax described in pmrep.conf(5). The following options are common with pmrep.conf: version, source, speclocal, derived, header, globals, samples, interval, type, type_prefer, ignore_incompat, names_change, instances, live_filter, rank, limit_filter, limit_filter_force, invert_filter, predicate, omit_flat, include_labels, precision, precision_force, count_scale, count_scale_force, space_scale, space_scale_force, time_scale, time_scale_force. The rest of the pmrep.conf options are recognized but ignored for compatibility. (they're just there, vibing π)
π pcp2xml specific options π
extended(boolean) β Write extended information about metrics. Corresponding command line option is-x. Defaults tono.everything(boolean) β Write everything known about metrics, including PCP internal IDs. Labels are, however, omitted for backward compatibility. Enableinclude_labelsto include them as well. Corresponding command line option is-X. Defaults tono.
π OPTIONS π
The available command line options are:
-0 precision,--precision-force=precisionβ Like-Pbut this option will override per-metric specifications.-4 action,--names-change=actionβ Specify which action to take on receiving a metric names change event during sampling. These events occur when a PMDA discovers new metrics sometime after starting up, and informs running client tools likepcp2xml. Valid values for action areupdate(refresh metrics being sampled),ignore(do nothing β the default behaviour) andabort(exit the program if such an event occurs).-5,--ignore-unknownβ Silently ignore any metric name that cannot be resolved. At least one metric must be found for the tool to start. (we need something, bestie π)-8 limit,--limit-filter=limitβ Limit results to instances with values above/below limit. A positive integer will include instances with values at or above the limit in reporting. A negative integer will include instances with values at or below the limit in reporting. A value of zero performs no limit filtering. This option will not override possible per-metric specifications. See also-Jand-N.-9 limit,--limit-filter-force=limitβ Like-8but this option will override per-metric specifications.-a archive,--archive=archiveβ Performance metric values are retrieved from the set of Performance Co-Pilot (PCP) archive files identified by the archive argument, which is a comma-separated list of names, each of which may be the base name of an archive or the name of a directory containing one or more archives.-A align,--align=alignβ Force the initial sample to be aligned on the boundary of a natural time unit align. Refer toPCPIntro(1)for a complete description of the syntax for align.--archive-folio=folioβ Read metric source archives from the PCP archive folio created by tools likepmchart(1)or, less often, manually withmkaf(1).-b scale,--space-scale=scaleβ Unit/scale for space (byte) metrics, possible values includebytes,Kbytes,KB,Mbytes,MB, and so forth. This option will not override possible per-metric specifications. See alsopmParseUnitsStr(3).-B scale,--space-scale-force=scaleβ Like-bbut this option will override per-metric specifications.-c config,--config=configβ Specify the config file or directory to use. In case config is a directory all files in it ending.confwill be included. The default is the first found of:./pcp2xml.conf,$HOME/.pcp2xml.conf,$HOME/pcp/pcp2xml.conf, and$PCP_SYSCONF_DIR/pcp2xml.conf. For details, see the above section andpmrep.conf(5).--container=containerβ Fetch performance metrics from the specified container, either local or remote (see-h).-C,--checkβ Exit before reporting any values, but after parsing the configuration and metrics and printing possible headers. (a lil sneak peek, then dip π)--daemonizeβ Daemonise on startup.-e derived,--derived=derivedβ Specify derived performance metrics. If derived starts with a slash (/) or with a dot (.) it will be interpreted as a PCP derived metrics configuration file, otherwise it will be interpreted as comma- or semicolon-separated derived metric expressions. For complete description of derived metrics and PCP derived metrics configuration files seepmLoadDerivedConfig(3)andpmRegisterDerived(3). Alternatively, usingpmrep.conf(5)configuration syntax allows defining derived metrics as part of metricsets.
In case of issues with derived metrics, review the aforementioned manual pages in detail and ensure all the required metrics are available, especially when using archives. Use -Dderive to see additional debug information about parsing derived metrics. π
-G,--no-globalsβ Do not include global metrics in reporting (seepmrep.conf(5)).-f format,--timestamp-format=formatβ Use the format string for formatting the timestamp. The format will be used with Python'sdatetime.strftimemethod which is mostly the same as that described instrftime(3). The default is%Y-%m-%d %H:%M:%S.-F outfile,--output-file=outfileβ Specify the output file outfile.-h host,--host=hostβ Fetch performance metrics frompmcd(1)on host, rather than from the defaultlocalhost. (go touch some remote grass π±)-H,--no-headerβ Do not print any headers.-i instances,--instances=instancesβ Retrieve and report only the specified metric instances. By default all instances, present and future, are reported.
Refer to pmrep(1) for complete description of this option.
-I,--ignore-incompatβ Ignore incompatible metrics. By default incompatible metrics (that is, their type is unsupported or they cannot be scaled as requested) will causepcp2xmlto terminate with an error message. With this option all incompatible metrics are silently omitted from reporting. This may be especially useful when requesting non-leaf nodes of the PMNS tree for reporting.-j,--live-filterβ Perform instance live filtering. This allows capturing all named instances even if processes are restarted at some point (unlike without live filtering). Performing live filtering over a huge number of instances will add some internal overhead so a bit of user caution is advised. See also-n.-J rank,--rank=rankβ Limit results to highest/lowest ranked instances of set-valued metrics. A positive integer will include highest valued instances in reporting. A negative integer will include lowest valued instances in reporting. A value of zero performs no ranking. Ranking does not imply sorting, see-6. See also-8.-K spec,--spec-local=specβ When fetching metrics from a local context (see-L), the-Koption may be used to control the DSO PMDAs that should be made accessible. The spec argument conforms to the syntax described inpmSpecLocalPMDA(3). More than one-Koption may be used.-L,--local-PMDAβ Use a local context to collect metrics from DSO PMDAs on the local host without PMCD. See also-K.-m,--include-labelsβ Include PCP metric labels in the output. π·οΈ-n,--invert-filterβ Perform ranking before live filtering. By default instance live filtering (when requested, see-j) happens before instance ranking (when requested, see-J). With this option the logic is inverted and ranking happens before live filtering.-N predicate,--predicate=predicateβ Specify a comma-separated list of predicate filter reference metrics. By default ranking (see-J) happens for each metric individually. With predicates, ranking is done only for the specified predicate metrics. When reporting, rest of the metrics sharing the same instance domain (seePCPIntro(1)) as the predicate will include only the highest/lowest ranking instances of the corresponding predicate. Ranking does not imply sorting, see-6.
So for example, using proc.memory.rss (resident memory size of process) as the predicate metric together with proc.io.total_bytes and mem.util.used as metrics to be reported, only the processes using most/least (as per -J) memory will be included when reporting total bytes written by processes. Since mem.util.used is a single-valued metric (thus not sharing the same instance domain as the process related metrics), it will be reported as usual.
-O origin,--origin=originβ When reporting archived metrics, start reporting at origin within the time window (see-Sand-T). Refer toPCPIntro(1)for a complete description of the syntax for origin.-Pprecision,--precision=precision β this is your glow-up for numbers that aren't whole π it sets the precision used for numeric non-integer output values. Default vibe is 3 decimal places (when applicable, bestie). Heads up tho: this will not override any per-metric specifications that are already doing their thing.-qscale,--count-scale=scale β the unit/scale for count metrics, and the possible values are:count x 10^-1,count,count x 10,count x 10^2, and so on and so forth, all the way from10^-8to10^7. (These values are currently space-sensitive.) Like-P, this will not override possible per-metric specifications. Also seepmParseUnitsStr(3)for the lore β¨-Qscale,--count-scale-force=scale β literally-qbut it will override per-metric specifications. Forceful queen energy π-r,--rawβ output raw metric values, do not convert cumulative counters to rates. This one will override possible per-metric specifications. No conversion, just vibes.-R,--raw-preferβ like-rbut it will not override per-metric specifications. Softer, gentler, still raw πΈ-ssamples,--samples=samples β the samples argument defines how many samples get retrieved and reported. If samples is0, or if-sisn't specified at all,pcp2xmlwill sample and report continuously (that's real time mode, babe) or until the end of the set of PCP archives (that's archive mode). See also-T.-Sstarttime,--start=starttime β when you're reporting archived metrics, the report gets restricted to only those records logged at or after starttime. Go checkPCPIntro(1)for the complete description of the syntax for starttime, bestie.-tinterval,--interval=interval β sets the reporting interval to something other than the default1second. The interval argument follows the syntax described inPCPIntro(1), and in the simplest form it may just be an unsigned integer (in which case the implied units are seconds). See also the-Toption.-Tendtime,--finish=endtime β when reporting archived metrics, the report gets restricted to those records logged before or at endtime. Refer toPCPIntro(1)for a complete description of the syntax for endtime.
When this is used to define the runtime before pcp2xml will exit: if no samples is given (peep -s) then the number of reported samples depends on interval (peep -t). If samples is given then interval will be adjusted to allow reporting of samples during runtime. And in case all of -T, -s, and -t are given, endtime determines the actual time pcp2xml will run. It's giving main character decision-maker π€
-v,--omit-flatβ report only set-valued metrics with instances (likedisk.dev.read) and omit single-valued ``flat'' metrics without instances (likekernel.all.sysfork). See-iand-I.-V,--versionβ display the version number and exit. Short and sweet, iconic.-x,--with-extendedβ write extended information. That's it, that's the option β¨-X,--with-everythingβ write everything known about metrics, including PCP internal IDs. Labels are, however, omitted for backward compatibility β so use-mto include them as well. Go big or go home π-yscale,--time-scale=scale β unit/scale for time metrics, possible values includenanosec,ns,microsec,us,millisec,ms, and so forth up tohour,hr. This option will not override possible per-metric specifications. See alsopmParseUnitsStr(3).-Yscale,--time-scale-force=scale β like-ybut this option will override per-metric specifications. Again: forceful. Again: queen.-z,--hostzoneβ use the local timezone of the host that is the source of the performance metrics, as identified by either the-hor the-aoptions. The default is to use the timezone of the local host. Timezone tourism fr fr π-Ztimezone,--timezone=timezone β use timezone for the date and time. Timezone is in the format of the environment variableTZas described inenviron(7). Note that when including a timezone string in output, ISO 8601-style UTC offsets are used (so something like-Z EST+5will becomeUTC-5). Math is mathing π-?,--helpβ display the usage message and exit. Your little rescue ladder πͺ
ποΈ FILES ποΈ
pcp2xml.confβ thepcp2xmlconfiguration file (see-c)$PCP_SYSCONF_DIR/pmrep/*.confβ system provided defaultpmrepconfiguration files
π 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).
For environment variables affecting PCP tools, see pmGetOptions(3).
Of particular note, PCP_DISCRETE_ONCE can be set to ensure that discrete metric values are reported only once, unless they change at some point. One and done, bestie π
π DEBUGGING OPTIONS π
The -D or --debug option enables the output of additional diagnostics on stderr to help triage problems, although ngl the information is sometimes cryptic and primarily intended to provide guidance for developers rather than for end-users. 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.
Heads up: cryptic dev-mode output ahead. It's not always cute, but it is helpful for triage.
π SEE ALSO π
PCPIntro(1), mkaf(1), pcp(1), pcp2elasticsearch(1), pcp2graphite(1), pcp2influxdb(1), pcp2json(1), pcp2spark(1), pcp2xlsx(1), pcp2zabbix(1), pmcd(1), pminfo(1), pmrep(1), pmGetOptions(3), pmLoadDerivedConfig(3), pmParseUnitsStr(3), pmRegisterDerived(3), pmSpecLocalPMDA(3), LOGARCHIVE(5), pcp.conf(5), pmrep.conf(5), PMNS(5) and environ(7).
and that's the whole page, bestie π«Ά this one's from Performance Co-Pilot, filed under PCP, and it lives at PCP2XML(1) in section 1. go read it, use it, slay with it. 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
- 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-export-pcp2xml 7.2.1-2build1
- Copyright (C) 2015-2021 Marko Myllynen <myllynen@redhat.com>
- Copyright (C) 2016-2018 Red Hat
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms