PCP2INFLUXDB(1)
π pcp2influxdb β like, the pcp-to-influxdb metrics exporter π
okay bestie, so this is the PCP2INFLUXDB(1) page, from the General Commands Manual section, and honestly? it's a whole vibe. it's long, so we're doing this in parts. part 1, let's go π«Ά
β¨ NAME β¨
pcp2influxdb β the pcp-to-influxdb metrics exporter, no cap π
πΈ SYNOPSIS πΈ
pcp2influxdb [-CGHIjLnrRvV?] [-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] [-E
password] [-g server] [-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] [-U username] [-x
database] [-X tags] [-y|-Y time-scale] metricspec [...]
like, that's the whole shape of the command. flags go brrr β
π¦ DESCRIPTION π¦
pcp2influxdb is a customizable performance metrics exporter tool that goes from PCP to InfluxDB. literally any available performance metric β live or archived, system and/or application β can be picked for exporting, and you can do the picking either with command line arguments or with a configuration file. iconic behavior honestly π
pcp2influxdb is a close relative of pmrep(1). so if you wanna know about the metricspec description that pcp2influxdb accepts on its command line β go read pmrep(1), bestie, it's all there. and for the description of the pcp2influxdb.conf configuration file syntax, see pmrep.conf(5). this page right here is only about the stuff that's specific to pcp2influxdb and the ways its config file differs from pmrep.conf(5). pmrep(1) also lists some usage examples, and most of those work with pcp2influxdb too π
only the command line options listed on this page are supported. other options that exist for pmrep(1)? not supported. periodt.
okay and here's the hierarchy of who-wins, and it matters:
- 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).
so it's env beats defaults, config beats env, command line beats everything. the main character always wins π
π CONFIGURATION FILE π
pcp2influxdb uses a configuration file with syntax described in pmrep.conf(5).
these options are the ones it has in common with pmrep.conf:
versionsourcespeclocalderivedheaderglobalssamplesintervaltypetype_preferignore_incompatnames_changeinstanceslive_filterranklimit_filterlimit_filter_forceinvert_filterpredicateomit_flatprecisionprecision_forcecount_scalecount_scale_forcespace_scalespace_scale_forcetime_scaletime_scale_force
and the rest of the pmrep.conf options? they're recognized but ignored, purely for compatibility. like they're at the party but they're not dancing π«Ά
π pcp2influxdb specific options π
influx_server (string)
Specify the destination InfluxDB server. the corresponding command line option is -g. defaults to http://127.0.0.1:8086. β¨
influx_db (string)
Specify the metrics database. the corresponding command line option is -x. defaults to pcp.
influx_user (string)
Specify the username for the database. the corresponding command line option is -U. Undefined by default β meaning no authentication is attempted.
influx_pass (string)
Specify the password for the database. the corresponding command line option is -E. Undefined by default β meaning no authentication is attempted.
influx_tags (string)
Specify string of tags to add to the metrics. the corresponding command line option is -X. Undefined by default.
β¨ OPTIONS β¨
the available command line options are, and yes we're doing all of them, buckle up:
-0precision,--precision-force=precisionβ like-Pbut this one will override per-metric specifications. it's giving "I said what I said" π-4action,--names-change=actionβ specify which action to take on receiving a metric names change event during sampling. these events happen when a PMDA discovers new metrics sometime after starting up, and then informs running client tools likepcp2influxdb. valid values for action are:updateβ refresh metrics being sampledignoreβ do nothing, and this is the default behaviourabortβ exit the program if such an event occurs π
-5,--ignore-unknownβ silently ignore any metric name that cannot be resolved. but heads up: at least one metric must be found for the tool to start. so it can't be all ghosts π»-8limit,--limit-filter=limitβ limit results to instances with values above/below limit. a positive integer includes instances with values at or above the limit in reporting. a negative integer includes 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.-9limit,--limit-filter-force=limitβ like-8but this option will override per-metric specifications. forceful queen π-aarchive,--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. π-Aalign,--align=alignβ force the initial sample to be aligned on the boundary of a natural time unit align. refer to PCPIntro(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 like pmchart(1) or, less often, manually with mkaf(1). very "crafted by hand" energy π-bscale,--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 also pmParseUnitsStr(3).-Bscale,--space-scale-force=scaleβ like-bbut this option will override per-metric specifications.-cconfig,--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:./pcp2influxdb.conf,$HOME/.pcp2influxdb.conf,$HOME/pcp/pcp2influxdb.conf, and$PCP_SYSCONF_DIR/pcp2influxdb.conf. for details, see the above section and pmrep.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. it's the "just checking, not committing" option π--daemonizeβ daemonize on startup. bye bestie, you live in the background now π-ederived,--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 a complete description of derived metrics and PCP derived metrics configuration files see pmLoadDerivedConfig(3) and pmRegisterDerived(3). alternatively, using pmrep.conf(5) configuration syntax allows defining derived metrics as part of metricsets.
and if you're having issues with derived metrics: review those manual pages in detail and make sure all the required metrics are available, especially when using archives. use -Dderive to see additional debug information about parsing derived metrics. π₯
-Epassword,--db-pass=passwordβ specify the database password. π€«-gserver,--db-server=serverβ destination InfluxDB server.-G,--no-globalsβ do not include global metrics in reporting (see pmrep.conf(5)). we're going local-only, periodt.-hhost,--host=hostβ fetch performance metrics from pmcd(1) on host, rather than from the defaultlocalhost.-H,--no-headerβ do not print any headers. minimalism, we love her β¨-iinstances,--instances=instancesβ retrieve and report only the specified metric instances. by default all instances, present and future, are reported.
refer to pmrep(1) for a 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 causepcp2influxdbto 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). but 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. π¦-Jrank,--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.-Kspec,--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 in pmSpecLocalPMDA(3). more than one-Koption may be used. stack 'em up π-L,--local-PMDAβ use a local context to collect metrics from DSO PMDAs on the local host without PMCD. see also-K.-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. flipping the script π-Npredicate,--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, the rest of the metrics sharing the same instance domain (see PCPIntro(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. and 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. see, it all makes sense π
-Oorigin,--origin=originβ when reporting archived metrics, start reporting at origin within the time window (see-Sand-T). refer to PCPIntro(1) for a complete description of the syntax for origin.-P precision,--precision=precisionβ bestie, this one sets the precision for your numeric non-integer output values β¨. Default vibe is 3 decimal places (when applicable, okay, when applicable). Heads up tho: this will not override any per-metric specifications, so don't come for me when your custom metrics do their own thing π .-q scale,--count-scale=scaleβ unit/scale for your count metrics π. Possible values includecount x 10^-1,count,count x 10,count x 10^2, and so forth from10^-8to10^7. Not me warning you: (these values are currently space-sensitive π« ). This option will not override possible per-metric specifications. See alsopmParseUnitsStr(3).-Q scale,--count-scale-force=scaleβ like-qbut this one is giving main character energy and will override per-metric specifications π.-r,--rawβ output raw metric values, do not convert cumulative counters to rates. This option will override possible per-metric specifications π₯.-R,--raw-preferβ like-rbut lowkey respectful: this option will not override per-metric specifications πΈ.-s samples,--samples=samplesβ the samples argument defines the number of samples to be retrieved and reported π. If samples is0or-sis not specified,pcp2influxdbwill sample and report continuously (in real time mode) or until the end of the set of PCP archives (in archive mode). See also-T.-S starttime,--start=starttimeβ when reporting archived metrics, the report will be restricted to those records logged at or after starttime β°. Refer toPCPIntro(1)for a complete description of the syntax for starttime.-t interval,--interval=intervalβ set the reporting interval to something other than the default1second. The interval argument follows the syntax described inPCPIntro(1), and in the simplest form may be an unsigned integer (the implied units in this case are seconds). See also the-Toption π«.-T endtime,--finish=endtimeβ when reporting archived metrics, the report will be restricted to those records logged before or at endtime. Refer toPCPIntro(1)for a complete description of the syntax for endtime.
When used to define the runtime before pcp2influxdb will exit, if no samples is given (see -s) then the number of reported samples depends on interval (see -t). If samples is given then interval will be adjusted to allow reporting of samples during runtime. In case all of -T, -s, and -t are given, endtime determines the actual time pcp2influxdb will run π.
-U username,--db-user=usernameβ specify the database username π.-v,--omit-flatβ report only set-valued metrics with instances (e.g.disk.dev.read) and omit single-valued ``flat'' metrics without instances (e.g.kernel.all.sysfork) π. See-iand-I.-V,--versionβ display version number and exit. slay π-x database,--db-name=databaseβ specify the metrics database name ποΈ.-X tags,--db-tags=tagsβ specify strings of tags to add to the metrics π·οΈ.-y scale,--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).-Y scale,--time-scale-force=scaleβ like-ybut this option will override per-metric specifications π.-?,--helpβ display usage message and exit π«Ά.
π FILES π
pcp2influxdb.confβpcp2influxdbconfiguration 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 π.
π 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 π. 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 π.
π SEE ALSO π
PCPIntro(1), mkaf(1), pcp(1), pcp2elasticsearch(1), pcp2graphite(1), pcp2json(1), pcp2spark(1), pcp2xlsx(1), pcp2xml(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) and PMNS(5) π
and that's a wrap bestie π this page is brought to you by Performance Co-Pilot (that's the source, and it's the PCP version, iykyk), filed under PCP2INFLUXDB(1) β go forth and pipe your metrics, you absolute icon πβ¨π¦
π¦ 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-pcp2influxdb 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