1PCP2XML(1) General Commands Manual PCP2XML(1)
2
3
4
6 pcp2xml - pcp-to-xml metrics exporter
7
9 pcp2xml [-5CGHIjLmnrRvVxXz?] [-4 action] [-8|-9 limit] [-a archive]
10 [-A align] [--archive-folio folio] [-b|-B space-scale] [-c config]
11 [--container container] [--daemonize] [-e derived] [-f format] [-F out‐
12 file] [-h host] [-i instances] [-J rank] [-K spec] [-N predicate] [-O
13 origin] [-P|-0 precision] [-q|-Q count-scale] [-s samples] [-S start‐
14 time] [-t interval] [-T endtime] [-y|-Y time-scale] [-Z timezone] met‐
15 ricspec [...]
16
18 pcp2xml is a customizable performance metrics exporter tool from PCP to
19 XML. Any available performance metric, live or archived, system and/or
20 application, can be selected for exporting using either command line
21 arguments or a configuration file.
22
23 pcp2xml is a close relative of pmrep(1). Please refer to pmrep(1) for
24 the metricspec description accepted on pcp2xml command line and
25 pmrep.conf(5) for description of the pcp2xml.conf configuration file
26 overall syntax, this page describes pcp2xml specific options and con‐
27 figuration file differences with pmrep.conf(5). pmrep(1) also lists
28 some usage examples of which most are applicable with pcp2xml as well.
29
30 Only the command line options listed on this page are supported, other
31 options recognized by pmrep(1) are not supported.
32
33 Options via environment values (see pmGetOptions(3)) override the cor‐
34 responding built-in default values (if any). Configuration file
35 options override the corresponding environment variables (if any).
36 Command line options override the corresponding configuration file
37 options (if any).
38
40 pcp2xml uses a configuration file with overall syntax described in
41 pmrep.conf(5). The following options are common with pmrep.conf: ver‐
42 sion, source, speclocal, derived, header, globals, samples, interval,
43 type, type_prefer, ignore_incompat, names_change, instances, live_fil‐
44 ter, rank, limit_filter, limit_filter_force, invert_filter, predicate,
45 omit_flat, include_labels, precision, precision_force, count_scale,
46 count_scale_force, space_scale, space_scale_force, time_scale,
47 time_scale_force. The output option is recognized but ignored for
48 pmrep.conf compatibility.
49
50 pcp2xml specific options
51 extended (boolean)
52 Write extended information about metrics. Corresponding command
53 line option is -x. Default is no.
54
55 everything (boolean)
56 Write everything known about metrics, including PCP internal IDs.
57 Labels are, however, omitted for backward compatibility, use
58 include_labels yes to include them as well. Corresponding command
59 line option is -X. Default is no.
60
62 The available command line options are:
63
64 -0 precision, --precision-force=precision
65 Like -P but this option will override per-metric specifications.
66
67 -4 action, --names-change=action
68 Specify which action to take on receiving a metric names change
69 event during sampling. These events occur when a PMDA discovers
70 new metrics sometime after starting up, and informs running client
71 tools like pcp2xml. Valid values for action are update (refresh
72 metrics being sampled), ignore (do nothing - the default behav‐
73 iour) and abort (exit the program if such an event happens).
74
75 -5, --ignore-unknown
76 Silently ignore any metric name that cannot be resolved. At least
77 one metric must be found for the tool to start.
78
79 -8 limit, --limit-filter=limit
80 Limit results to instances with values above/below limit. A posi‐
81 tive integer will include instances with values at or above the
82 limit in reporting. A negative integer will include instances
83 with values at or below the limit in reporting. A value of zero
84 performs no limit filtering. This option will not override possi‐
85 ble per-metric specifications. See also -J and -N.
86
87 -9 limit, --limit-filter-force=limit
88 Like -8 but this option will override per-metric specifications.
89
90 -a archive, --archive=archive
91 Performance metric values are retrieved from the set of Perfor‐
92 mance Co-Pilot (PCP) archive log files identified by the archive
93 argument, which is a comma-separated list of names, each of which
94 may be the base name of an archive or the name of a directory con‐
95 taining one or more archives.
96
97 -A align, --align=align
98 Force the initial sample to be aligned on the boundary of a natu‐
99 ral time unit align. Refer to PCPIntro(1) for a complete descrip‐
100 tion of the syntax for align.
101
102 --archive-folio=folio
103 Read metric source archives from the PCP archive folio created by
104 tools like pmchart(1) or, less often, manually with mkaf(1).
105
106 -b scale, --space-scale=scale
107 Unit/scale for space (byte) metrics, possible values include
108 bytes, Kbytes, KB, Mbytes, MB, and so forth. This option will not
109 override possible per-metric specifications. See also pmParseU‐
110 nitsStr(3).
111
112 -B scale, --space-scale-force=scale
113 Like -b but this option will override per-metric specifications.
114
115 -c config, --config=config
116 Specify the config file to use. The default is the first found
117 of: ./pcp2xml.conf, $HOME/.pcp2xml.conf, $HOME/pcp/pcp2xml.conf,
118 and $PCP_SYSCONF_DIR/pcp2xml.conf. For details, see the above
119 section and pmrep.conf(5).
120
121 --container=container
122 Fetch performance metrics from the specified container, either
123 local or remote (see -h).
124
125 -C, --check
126 Exit before reporting any values, but after parsing the configura‐
127 tion and metrics and printing possible headers.
128
129 --daemonize
130 Daemonize on startup.
131
132 -e derived, --derived=derived
133 Specify derived performance metrics. If derived starts with a
134 slash (``/'') or with a dot (``.'') it will be interpreted as a
135 derived metrics configuration file, otherwise it will be inter‐
136 preted as comma- or semicolon-separated derived metric expres‐
137 sions. For details see pmLoadDerivedConfig(3) and pmRegister‐
138 Derived(3).
139
140 -G, --no-globals
141 Do not include global metrics in reporting (see pmrep.conf(5)).
142
143 -f format, --timestamp-format=format
144 Use the format string for formatting the timestamp. The format
145 will be used with Python's datetime.strftime method which is
146 mostly the same as that described in strftime(3). The default is
147 %Y-%m-%d %H:%M:%S.
148
149 -F outfile, --output-file=outfile
150 Specify the output file outfile.
151
152 -h host, --host=host
153 Fetch performance metrics from pmcd(1) on host, rather than from
154 the default localhost.
155
156 -H, --no-header
157 Do not print any headers.
158
159 -i instances, --instances=instances
160 Report only the listed instances from current instances (if
161 present, see also -j). By default all instances, present and
162 future, are reported. This is a global option that is used for
163 all metrics unless a metric-specific instance definition is pro‐
164 vided as part of a metricspec. By default single-valued ``flat''
165 metrics without multiple instances are still reported as usual,
166 use -v to change this. Please refer to pmrep(1) for more details
167 on this option.
168
169 -I, --ignore-incompat
170 Ignore incompatible metrics. By default incompatible metrics
171 (that is, their type is unsupported or they cannot be scaled as
172 requested) will cause pcp2xml to terminate with an error message.
173 With this option all incompatible metrics are silently omitted
174 from reporting. This may be especially useful when requesting
175 non-leaf nodes of the PMNS tree for reporting.
176
177 -j, --live-filter
178 Perform instance live filtering. This allows capturing all fil‐
179 tered instances even if processes are restarted at some point
180 (unlike without live filtering). Performing live filtering over a
181 huge amount of instances will add some internal overhead so a bit
182 of user caution is advised. See also -n.
183
184 -J rank, --rank=rank
185 Limit results to highest/lowest ranked instances of set-valued
186 metrics. A positive integer will include highest valued instances
187 in reporting. A negative integer will include lowest valued
188 instances in reporting. A value of zero performs no ranking.
189 Ranking does not imply sorting, see -6. See also -8.
190
191 -K spec, --spec-local=spec
192 When fetching metrics from a local context (see -L), the -K option
193 may be used to control the DSO PMDAs that should be made accessi‐
194 ble. The spec argument conforms to the syntax described in
195 pmSpecLocalPMDA(3). More than one -K option may be used.
196
197 -L, --local-PMDA
198 Use a local context to collect metrics from DSO PMDAs on the local
199 host without PMCD. See also -K.
200
201 -m, --include-labels
202 Include metric labels in the output.
203
204 -n, --invert-filter
205 Perform ranking before live filtering. By default instance live
206 filtering (when requested, see -j) happens before instance ranking
207 (when requested, see -J). With this option the logic is inverted
208 and ranking happens before live filtering.
209
210 -N predicate, --predicate=predicate
211 Specify a comma-separated list of predicate filter reference met‐
212 rics. By default ranking (see -J) happens for each metric indi‐
213 vidually. With predicates, ranking is done only for the specified
214 predicate metrics. When reporting, rest of the metrics sharing
215 the same instance domain (see PCPIntro(1)) as the predicate will
216 include only the highest/lowest ranking instances of the corre‐
217 sponding predicate. Ranking does not imply sorting, see -6.
218
219 So for example, using proc.memory.rss (resident memory size of
220 process) as the predicate metric together with proc.io.total_bytes
221 and mem.util.used as metrics to be reported, only the processes
222 using most/least (as per -J) memory will be included when report‐
223 ing total bytes written by processes. Since mem.util.used is a
224 single-valued metric (thus not sharing the same instance domain as
225 the process-related metrics), it will be reported as usual.
226
227 -O origin, --origin=origin
228 When reporting archived metrics, start reporting at origin within
229 the time window (see -S and -T). Refer to PCPIntro(1) for a com‐
230 plete description of the syntax for origin.
231
232 -P precision, --precision=precision
233 Use precision for numeric non-integer output values. The default
234 is to use 3 decimal places (when applicable). This option will
235 not override possible per-metric specifications.
236
237 -q scale, --count-scale=scale
238 Unit/scale for count metrics, possible values include count x
239 10^-1, count, count x 10, count x 10^2, and so forth from 10^-8 to
240 10^7. (These values are currently space-sensitive.) This option
241 will not override possible per-metric specifications. See also
242 pmParseUnitsStr(3).
243
244 -Q scale, --count-scale-force=scale
245 Like -q but this option will override per-metric specifications.
246
247 -r, --raw
248 Output raw metric values, do not convert cumulative counters to
249 rates. This option will override possible per-metric specifica‐
250 tions.
251
252 -R, --raw-prefer
253 Like -r but this option will not override per-metric specifica‐
254 tions.
255
256 -s samples, --samples=samples
257 The samples argument defines the number of samples to be retrieved
258 and reported. If samples is 0 or -s is not specified, pcp2xml
259 will sample and report continuously (in real time mode) or until
260 the end of the set of PCP archives (in archive mode). See also
261 -T.
262
263 -S starttime, --start=starttime
264 When reporting archived metrics, the report will be restricted to
265 those records logged at or after starttime. Refer to PCPIntro(1)
266 for a complete description of the syntax for starttime.
267
268 -t interval, --interval=interval
269 Set the reporting interval to something other than the default 1
270 second. The interval argument follows the syntax described in
271 PCPIntro(1), and in the simplest form may be an unsigned integer
272 (the implied units in this case are seconds). See also the -T
273 option.
274
275 -T endtime, --finish=endtime
276 When reporting archived metrics, the report will be restricted to
277 those records logged before or at endtime. Refer to PCPIntro(1)
278 for a complete description of the syntax for endtime.
279
280 When used to define the runtime before pcp2xml will exit, if no
281 samples is given (see -s) then the number of reported samples
282 depends on interval (see -t). If samples is given then interval
283 will be adjusted to allow reporting of samples during runtime. In
284 case all of -T, -s, and -t are given, endtime determines the
285 actual time pcp2xml will run.
286
287 -v, --omit-flat
288 Omit single-valued ``flat'' metrics from reporting, only consider
289 set-valued metrics (i.e., metrics with multiple values) for
290 reporting. See -i and -I.
291
292 -V, --version
293 Display version number and exit.
294
295 -x, --with-extended
296 Write extended information.
297
298 -X, --with-everything
299 Write everything known about metrics, including PCP internal IDs.
300 Labels are, however, omitted for backward compatibility, use -m to
301 include them as well.
302
303 -y scale, --time-scale=scale
304 Unit/scale for time metrics, possible values include nanosec, ns,
305 microsec, us, millisec, ms, and so forth up to hour, hr. This
306 option will not override possible per-metric specifications. See
307 also pmParseUnitsStr(3).
308
309 -Y scale, --time-scale-force=scale
310 Like -y but this option will override per-metric specifications.
311
312 -z, --hostzone
313 Use the local timezone of the host that is the source of the per‐
314 formance metrics, as identified by either the -h or the -a
315 options. The default is to use the timezone of the local host.
316
317 -Z timezone, --timezone=timezone
318 Use timezone for the date and time. Timezone is in the format of
319 the environment variable TZ as described in environ(7). Note that
320 when including a timezone string in output, ISO 8601 -style UTC
321 offsets are used (so something like -Z EST+5 will become UTC-5).
322
323 -?, --help
324 Display usage message and exit.
325
327 pcp2xml.conf
328 pcp2xml configuration file (see -c)
329
331 Environment variables with the prefix PCP_ are used to parameterize the
332 file and directory names used by PCP. On each installation, the file
333 /etc/pcp.conf contains the local values for these variables. The
334 $PCP_CONF variable may be used to specify an alternative configuration
335 file, as described in pcp.conf(5).
336
337 For environment variables affecting PCP tools, see pmGetOptions(3).
338
340 mkaf(1), PCPIntro(1), pcp(1), pcp2elasticsearch(1), pcp2graphite(1),
341 pcp2influxdb(1), pcp2json(1), pcp2spark(1), pcp2xlsx(1), pcp2zabbix(1),
342 pmcd(1), pminfo(1), pmrep(1), pmGetOptions(3), pmSpecLocalPMDA(3),
343 pmLoadDerivedConfig(3), pmParseUnitsStr(3), pmRegisterDerived(3), LOGA‐
344 RCHIVE(5), pcp.conf(5), PMNS(5), pmrep.conf(5) and environ(7).
345
346
347
348Performance Co-Pilot PCP PCP2XML(1)