1PCP2XML(1)                  General Commands Manual                 PCP2XML(1)
2
3
4

NAME

6       pcp2xml - pcp-to-xml metrics exporter
7

SYNOPSIS

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

DESCRIPTION

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).  Refer  to  pmrep(1)  for  the
24       metricspec  description  accepted  on  pcp2xml  command  line.  See pm‐
25       rep.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 op‐
35       tions override the corresponding environment variables (if any).   Com‐
36       mand line options override the corresponding configuration file options
37       (if any).
38

CONFIGURATION FILE

40       pcp2xml uses a configuration file with overall syntax described in  pm‐
41       rep.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 pm‐
48       rep.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  in‐
58           clude_labels  yes  to  include them as well.  Corresponding command
59           line option is -X.  Default is no.
60

OPTIONS

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 or directory to use.  In case config is a
117            directory all files under it ending .conf will be  included.   The
118            default     is     the    first    found    of:    ./pcp2xml.conf,
119            $HOME/.pcp2xml.conf,          $HOME/pcp/pcp2xml.conf,          and
120            $PCP_SYSCONF_DIR/pcp2xml.conf.  For details, see the above section
121            and pmrep.conf(5).
122
123       --container=container
124            Fetch performance metrics from the specified container, either lo‐
125            cal or remote (see -h).
126
127       -C, --check
128            Exit before reporting any values, but after parsing the configura‐
129            tion and metrics and printing possible headers.
130
131       --daemonize
132            Daemonize on startup.
133
134       -e derived, --derived=derived
135            Specify derived performance metrics.  If  derived  starts  with  a
136            slash  (``/'')  or  with a dot (``.'') it will be interpreted as a
137            derived metrics configuration file, otherwise it  will  be  inter‐
138            preted  as  comma-  or  semicolon-separated derived metric expres‐
139            sions.  For details  see  pmLoadDerivedConfig(3)  and  pmRegister‐
140            Derived(3).
141
142       -G, --no-globals
143            Do not include global metrics in reporting (see pmrep.conf(5)).
144
145       -f format, --timestamp-format=format
146            Use  the  format  string for formatting the timestamp.  The format
147            will be used  with  Python's  datetime.strftime  method  which  is
148            mostly  the same as that described in strftime(3).  The default is
149            %Y-%m-%d %H:%M:%S.
150
151       -F outfile, --output-file=outfile
152            Specify the output file outfile.
153
154       -h host, --host=host
155            Fetch performance metrics from pmcd(1) on host, rather  than  from
156            the default localhost.
157
158       -H, --no-header
159            Do not print any headers.
160
161       -i instances, --instances=instances
162            Retrieve  and  report only the specified metric instances.  By de‐
163            fault all instances, present and future, are reported.
164
165            Refer to pmrep(1) for complete description of this option.
166
167       -I, --ignore-incompat
168            Ignore incompatible  metrics.   By  default  incompatible  metrics
169            (that  is,  their  type is unsupported or they cannot be scaled as
170            requested) will cause pcp2xml to terminate with an error  message.
171            With  this  option  all  incompatible metrics are silently omitted
172            from reporting.  This may be  especially  useful  when  requesting
173            non-leaf nodes of the PMNS tree for reporting.
174
175       -j, --live-filter
176            Perform  instance live filtering.  This allows capturing all named
177            instances even if processes are restarted at  some  point  (unlike
178            without  live  filtering).   Performing live filtering over a huge
179            number of instances will add some internal overhead so  a  bit  of
180            user caution is advised.  See also -n.
181
182       -J rank, --rank=rank
183            Limit  results  to  highest/lowest  ranked instances of set-valued
184            metrics.  A positive integer will include highest valued instances
185            in  reporting.   A negative integer will include lowest valued in‐
186            stances in reporting.  A value of zero performs no ranking.  Rank‐
187            ing does not imply sorting, see -6.  See also -8.
188
189       -K spec, --spec-local=spec
190            When fetching metrics from a local context (see -L), the -K option
191            may be used to control the DSO PMDAs that should be made  accessi‐
192            ble.   The  spec  argument conforms to the syntax described in pm‐
193            SpecLocalPMDA(3).  More than one -K option may be used.
194
195       -L, --local-PMDA
196            Use a local context to collect metrics from DSO PMDAs on the local
197            host without PMCD.  See also -K.
198
199       -m, --include-labels
200            Include metric labels in the output.
201
202       -n, --invert-filter
203            Perform  ranking  before live filtering.  By default instance live
204            filtering (when requested, see -j) happens before instance ranking
205            (when  requested, see -J).  With this option the logic is inverted
206            and ranking happens before live filtering.
207
208       -N predicate, --predicate=predicate
209            Specify a comma-separated list of predicate filter reference  met‐
210            rics.   By  default ranking (see -J) happens for each metric indi‐
211            vidually.  With predicates, ranking is done only for the specified
212            predicate  metrics.   When  reporting, rest of the metrics sharing
213            the same instance domain (see PCPIntro(1)) as the  predicate  will
214            include  only  the  highest/lowest ranking instances of the corre‐
215            sponding predicate.  Ranking does not imply sorting, see -6.
216
217            So for example, using proc.memory.rss  (resident  memory  size  of
218            process) as the predicate metric together with proc.io.total_bytes
219            and mem.util.used as metrics to be reported,  only  the  processes
220            using  most/least (as per -J) memory will be included when report‐
221            ing total bytes written by processes.  Since  mem.util.used  is  a
222            single-valued metric (thus not sharing the same instance domain as
223            the process related metrics), it will be reported as usual.
224
225       -O origin, --origin=origin
226            When reporting archived metrics, start reporting at origin  within
227            the  time window (see -S and -T).  Refer to PCPIntro(1) for a com‐
228            plete description of the syntax for origin.
229
230       -P precision, --precision=precision
231            Use precision for numeric non-integer output values.  The  default
232            is  to  use  3 decimal places (when applicable).  This option will
233            not override possible per-metric specifications.
234
235       -q scale, --count-scale=scale
236            Unit/scale for count metrics,  possible  values  include  count  x
237            10^-1, count, count x 10, count x 10^2, and so forth from 10^-8 to
238            10^7.  (These values are currently space-sensitive.)  This  option
239            will  not  override  possible per-metric specifications.  See also
240            pmParseUnitsStr(3).
241
242       -Q scale, --count-scale-force=scale
243            Like -q but this option will override per-metric specifications.
244
245       -r, --raw
246            Output raw metric values, do not convert  cumulative  counters  to
247            rates.   This  option will override possible per-metric specifica‐
248            tions.
249
250       -R, --raw-prefer
251            Like -r but this option will not  override  per-metric  specifica‐
252            tions.
253
254       -s samples, --samples=samples
255            The samples argument defines the number of samples to be retrieved
256            and reported.  If samples is 0 or -s  is  not  specified,  pcp2xml
257            will  sample  and report continuously (in real time mode) or until
258            the end of the set of PCP archives (in archive  mode).   See  also
259            -T.
260
261       -S starttime, --start=starttime
262            When  reporting archived metrics, the report will be restricted to
263            those records logged at or after starttime.  Refer to  PCPIntro(1)
264            for a complete description of the syntax for starttime.
265
266       -t interval, --interval=interval
267            Set  the  reporting interval to something other than the default 1
268            second.  The interval argument follows  the  syntax  described  in
269            PCPIntro(1),  and  in the simplest form may be an unsigned integer
270            (the implied units in this case are seconds).  See also the -T op‐
271            tion.
272
273       -T endtime, --finish=endtime
274            When  reporting archived metrics, the report will be restricted to
275            those records logged before or at endtime.  Refer  to  PCPIntro(1)
276            for a complete description of the syntax for endtime.
277
278            When  used  to  define the runtime before pcp2xml will exit, if no
279            samples is given (see -s) then the number of reported samples  de‐
280            pends  on  interval  (see  -t).  If samples is given then interval
281            will be adjusted to allow reporting of samples during runtime.  In
282            case  all  of -T, -s, and -t are given, endtime determines the ac‐
283            tual time pcp2xml will run.
284
285       -v, --omit-flat
286            Report only set-valued metrics with instances (e.g. disk.dev.read)
287            and  omit  single-valued  ``flat'' metrics without instances (e.g.
288            kernel.all.sysfork).  See -i and -I.
289
290       -V, --version
291            Display version number and exit.
292
293       -x, --with-extended
294            Write extended information.
295
296       -X, --with-everything
297            Write everything known about metrics, including PCP internal  IDs.
298            Labels are, however, omitted for backward compatibility, use -m to
299            include them as well.
300
301       -y scale, --time-scale=scale
302            Unit/scale for time metrics, possible values include nanosec,  ns,
303            microsec, us, millisec, ms, and so forth up to hour, hr.  This op‐
304            tion will not override possible  per-metric  specifications.   See
305            also pmParseUnitsStr(3).
306
307       -Y scale, --time-scale-force=scale
308            Like -y but this option will override per-metric specifications.
309
310       -z, --hostzone
311            Use  the local timezone of the host that is the source of the per‐
312            formance metrics, as identified by either the -h  or  the  -a  op‐
313            tions.  The default is to use the timezone of the local host.
314
315       -Z timezone, --timezone=timezone
316            Use  timezone for the date and time.  Timezone is in the format of
317            the environment variable TZ as described in environ(7).  Note that
318            when  including  a  timezone string in output, ISO 8601 -style UTC
319            offsets are used (so something like -Z EST+5 will become UTC-5).
320
321       -?, --help
322            Display usage message and exit.
323

FILES

325       pcp2xml.conf
326            pcp2xml configuration file (see -c)
327

PCP ENVIRONMENT

329       Environment variables with the prefix PCP_ are used to parameterize the
330       file  and  directory names used by PCP.  On each installation, the file
331       /etc/pcp.conf contains the  local  values  for  these  variables.   The
332       $PCP_CONF  variable may be used to specify an alternative configuration
333       file, as described in pcp.conf(5).
334
335       For environment variables affecting PCP tools, see pmGetOptions(3).
336

SEE ALSO

338       mkaf(1), PCPIntro(1),  pcp(1),  pcp2elasticsearch(1),  pcp2graphite(1),
339       pcp2influxdb(1), pcp2json(1), pcp2spark(1), pcp2xlsx(1), pcp2zabbix(1),
340       pmcd(1), pminfo(1), pmrep(1), pmGetOptions(3), pmSpecLocalPMDA(3),  pm‐
341       LoadDerivedConfig(3),  pmParseUnitsStr(3),  pmRegisterDerived(3), LOGA‐
342       RCHIVE(5), pcp.conf(5), PMNS(5), pmrep.conf(5) and environ(7).
343
344
345
346Performance Co-Pilot                  PCP                           PCP2XML(1)
Impressum