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

NAME

6       pcp2json - pcp-to-json metrics exporter
7

SYNOPSIS

9       pcp2json   [-CEGHIjLnrRvVxXz?]    [-8|-9  limit]  [-a  archive]  [--ar‐
10       chive-folio folio] [-A align] [-b|-B space-scale] [-c  config]  [--con‐
11       tainer  container]  [--daemonize] [-e derived] [-f format] [-F outfile]
12       [-h host] [-i instances] [-J rank] [-K spec] [-N predicate] [-O origin]
13       [-P|-0  precision]  [-q|-Q count-scale] [-s samples] [-S starttime] [-t
14       interval] [-T endtime]  [-y|-Y  time-scale]  [-Z  timezone]  metricspec
15       [...]
16

DESCRIPTION

18       pcp2json  is  a customizable performance metrics exporter tool from PCP
19       to JSON.  Any available performance metric, live  or  archived,  system
20       and/or  application, can be selected for exporting using either command
21       line arguments or a configuration file.
22
23       pcp2json is a close relative of pmrep(1).  Please refer to pmrep(1) for
24       the  metricspec  description  accepted  on  pcp2json  command  line and
25       pmrep.conf(5) for description of the pcp2json.conf  configuration  file
26       overall  syntax, this page describes pcp2json 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 pcp2json 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

CONFIGURATION FILE

40       pcp2json 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,  instances,  live_filter,  rank,
44       limit_filter, limit_filter_force, invert_filter, predicate,  omit_flat,
45       precision,     precision_force,     count_scale,     count_scale_force,
46       space_scale, space_scale_force, time_scale, time_scale_force.  The out‐
47       put option is recognized but ignored for pmrep.conf compatibility.
48
49   pcp2json specific options
50       extended (boolean)
51           Write  extended  information  about metrics.  Corresponding command
52           line option is -x.  Default is no.
53
54       everything (boolean)
55           Write everything known about metrics, including PCP  internal  IDs.
56           Corresponding command line option is -X.  Default is no.
57
58       exact_types (boolean)
59           Write  numbers  as  number  data types, not as strings, potentially
60           losing some precision.  Corresponding command line  option  is  -E.
61           Default is no.
62

OPTIONS

64       The available command line options are:
65
66       -8 limit, --limit-filter=limit
67            Limit results to instances with values above/below limit.  A posi‐
68            tive integer will include instances with values at  or  above  the
69            limit  in  reporting.   A  negative integer will include instances
70            with values at or below the limit in reporting.  A value  of  zero
71            performs no limit filtering.  This option will not override possi‐
72            ble per-metric specifications.  See also -J and -N.
73
74       -9 limit, --limit-filter-force=limit
75            Like -8 but this option will override per-metric specifications.
76
77       -a archive, --archive=archive
78            Performance metric values are retrieved from the  set  of  Perfor‐
79            mance  Co-Pilot (PCP) archive log files identified by the argument
80            archive, which is a comma-separated list of names, each  of  which
81            may be the base name of an archive or the name of a directory con‐
82            taining one or more archives.
83
84       --archive-folio
85            Read metric source archives from the PCP archive folio created  by
86            tools like pmchart(1) or, less often, manually with mkaf(1).
87
88       -A align, --align=align
89            Force  the initial sample to be aligned on the boundary of a natu‐
90            ral time unit align.  Refer to PCPIntro(1) for a complete descrip‐
91            tion of the syntax for align.
92
93       -b scale, --space-scale=scale
94            Unit/scale  for  space  (byte)  metrics,  possible  values include
95            bytes, Kbytes, KB, Mbytes, MB, and so forth.  This option will not
96            override  possible  per-metric specifications.  See also pmParseU‐
97            nitsStr(3).
98
99       -B scale, --space-scale-force=scale
100            Like -b but this option will override per-metric specifications.
101
102       -c config, --config=config
103            Specify the config file to use.  The default is  the  first  found
104            of:             ./pcp2json.conf,             $HOME/.pcp2json.conf,
105            $HOME/pcp/pcp2json.conf, and $PCP_SYSCONF_DIR/pcp2json.conf.   For
106            details, see the above section and pmrep.conf(5).
107
108       --container
109            Fetch  performance  metrics  from  the specified container, either
110            local or remote (see -h).
111
112       -C, --check
113            Exit before reporting any values, but after parsing the configura‐
114            tion and metrics and printing possible headers.
115
116       --daemonize
117            Daemonize on startup.
118
119       -e derived, --derived=derived
120            Specify  derived  performance  metrics.   If derived starts with a
121            slash (``/'') or with a dot (``.'') it will be  interpreted  as  a
122            derived  metrics  configuration  file, otherwise it will be inter‐
123            preted as comma- or  semicolon-separated  derived  metric  expres‐
124            sions.   For  details  see  pmLoadDerivedConfig(3) and pmRegister‐
125            Derived(3).
126
127       -f format, --timestamp-format=format
128            Use the format string for formatting the  timestamp.   The  format
129            will  be  used  with  Python's  datetime.strftime  method which is
130            mostly the same as that described in strftime(3).  The default  is
131            %Y-%m-%d %H:%M:%S.
132
133       -F outfile, --output-file=outfile
134            Specify the output file outfile.
135
136       -G, --no-globals
137            Do not include global metrics in reporting (see pmrep.conf(5)).
138
139       -h host, --host=host
140            Fetch  performance  metrics from pmcd(1) on host, rather than from
141            the default localhost.
142
143       -H, --no-header
144            Do not print any headers.
145
146       -i instances, --instances=instances
147            Report only  the  listed  instances  from  current  instances  (if
148            present,  see  also  -j).   By  default all instances, present and
149            future, are reported.  This is a global option that  is  used  for
150            all  metrics  unless a metric-specific instance definition is pro‐
151            vided as part of a metricspec.  By default single-valued  ``flat''
152            metrics  without  multiple  instances are still reported as usual,
153            use -v to change this.  Please refer to pmrep(1) for more  details
154            on this option.
155
156       -I, --ignore-incompat
157            Ignore  incompatible  metrics.   By  default  incompatible metrics
158            (that is, their type is unsupported or they cannot  be  scaled  as
159            requested) will cause pcp2json to terminate with an error message.
160            With this option all incompatible  metrics  are  silently  omitted
161            from  reporting.   This  may  be especially useful when requesting
162            non-leaf nodes of the PMNS tree for reporting.
163
164       -j, --live-filter
165            Perform instance live filtering.  This allows capturing  all  fil‐
166            tered  instances  even  if  processes  are restarted at some point
167            (unlike without live filtering).  Doing live filtering over a huge
168            amount of instances naturally comes with some overhead so a bit of
169            user caution is advised.
170
171       -J rank, --rank=rank
172            Limit results to highest/lowest rank instances of set-valued  met‐
173            rics.  A positive integer will include highest valued instances in
174            reporting.   A  negative  integer  will  include   lowest   valued
175            instances in reporting.  A value of zero performs no ranking.  See
176            also -8.
177
178       -K spec, --spec-local=spec
179            When fetching metrics from a local context (see -L), the -K option
180            may  be used to control the DSO PMDAs that should be made accessi‐
181            ble.  The spec  argument  conforms  to  the  syntax  described  in
182            pmSpecLocalPMDA(3).  More than one -K option may be used.
183
184       -L, --local-PMDA
185            Use a local context to collect metrics from DSO PMDAs on the local
186            host without PMCD.  See also -K.
187
188       -n, --invert-filter
189            Perform ranking before live filtering.  By default  instance  live
190            filter  filtering (when requested, see -j) happens before instance
191            ranking (when requested, see -J).  With this option the  logic  is
192            inverted and ranking happens before live filtering.
193
194       -N predicate, --predicate=predicate
195            Specify  a comma-separated list of predicate filter reference met‐
196            rics.  By default ranking (see -J) happens for each  metric  indi‐
197            vidually.   With  predicate  filter  reference metrics, ranking is
198            done only for the specified metrics.  When reporting, the rest  of
199            the  metrics sharing the same instance domain (see PCPIntro(1)) as
200            the  predicates  will  include  only  the  highest/lowest  ranking
201            instances of the corresponding predicates.
202
203            So  for  example, when the using proc.memory.rss (resident size of
204            process) as the predicate and  including  proc.io.total_bytes  and
205            mem.util.used  as metrics to be reported, only the processes using
206            most/least memory (as per -J)  will  be  included  when  reporting
207            total  bytes  written by processes.  Since mem.util.used is a sin‐
208            gle-valued metric (thus not sharing the same  instance  domain  as
209            the process-related metrics), it will be reported as usual.
210
211       -O origin, --origin=origin
212            When  reporting archived metrics, start reporting at origin within
213            the time window (see -S and -T).  Refer to PCPIntro(1) for a  com‐
214            plete description of the syntax for origin.
215
216       -P precision, --precision=precision
217            Use  precision for numeric non-integer output values.  The default
218            is to use 3 decimal places (when applicable).   This  option  will
219            not override possible per-metric specifications.
220
221       -0 precision, --precision-force=precision
222            Like -P but this option will override per-metric specifications.
223
224       -q scale, --count-scale=scale
225            Unit/scale  for  count  metrics,  possible  values include count x
226            10^-1, count, count x 10, count x 10^2, and so forth from 10^-8 to
227            10^7.   (These values are currently space-sensitive.)  This option
228            will not override possible per-metric  specifications.   See  also
229            pmParseUnitsStr(3).
230
231       -Q scale, --count-scale-force=scale
232            Like -q but this option will override per-metric specifications.
233
234       -r, --raw
235            Output  raw  metric  values, do not convert cumulative counters to
236            rates.  This option will override possible  per-metric  specifica‐
237            tions.
238
239       -R, --raw-prefer
240            Like  -r  but  this option will not override per-metric specifica‐
241            tions.
242
243       -s samples, --samples=samples
244            The argument samples defines the number of samples to be retrieved
245            and  reported.   If  samples is 0 or -s is not specified, pcp2json
246            will sample and report continuously (in real time mode)  or  until
247            the  end  of  the set of PCP archives (in archive mode).  See also
248            -T.
249
250       -S starttime, --start=starttime
251            When reporting archived metrics, the report will be restricted  to
252            those  records logged at or after starttime.  Refer to PCPIntro(1)
253            for a complete description of the syntax for starttime.
254
255       -t interval, --interval=interval
256            The default update interval may be set to something other than the
257            default  1  second.   The  interval  argument  follows  the syntax
258            described in PCPIntro(1), and in  the  simplest  form  may  be  an
259            unsigned  integer  (the  implied  units in this case are seconds).
260            See also the -T option.
261
262       -T endtime, --finish=endtime
263            When reporting archived metrics, the report will be restricted  to
264            those  records  logged before or at endtime.  Refer to PCPIntro(1)
265            for a complete description of the syntax for endtime.
266
267            When used to define the runtime before pcp2json will exit,  if  no
268            samples  is  given  (see  -s)  then the number of reported samples
269            depends on interval (see -t).  If samples is given  then  interval
270            will be adjusted to allow reporting of samples during runtime.  In
271            case all of -T, -s, and  -t  are  given,  endtime  determines  the
272            actual time pcp2json will run.
273
274       -v, --omit-flat
275            Omit  single-valued ``flat'' metrics from reporting, only consider
276            set-valued  metrics  (i.e.,  metrics  with  multiple  values)  for
277            reporting.  See -i and -I.
278
279       -V, --version
280            Display version number and exit.
281
282       -x, --with-extended
283            Write extended information.
284
285       -X, --with-everything
286            Write everything known about metrics, including PCP internal IDs.
287
288       -y scale, --time-scale=scale
289            Unit/scale  for time metrics, possible values include nanosec, ns,
290            microsec, us, millisec, ms, and so forth up  to  hour,  hr.   This
291            option  will not override possible per-metric specifications.  See
292            also pmParseUnitsStr(3).
293
294       -Y scale, --time-scale-force=scale
295            Like -y but this option will override per-metric specifications.
296
297       -z, --hostzone
298            Use the local timezone of the host that is the source of the  per‐
299            formance  metrics,  as  identified  by  either  the  -h  or the -a
300            options.  The default is to use the timezone of the local host.
301
302       -Z timezone, --timezone=timezone
303            Use timezone for the date and time.  Timezone is in the format  of
304            the environment variable TZ as described in environ(7).  Note that
305            when including a timezone string in output, ISO  8601  -style  UTC
306            offsets are used (so something like -Z EST+5 will become UTC-5).
307
308       -?, --help
309            Display usage message and exit.
310

FILES

312       pcp2json.conf
313              pcp2json configuration file (see -c)
314

PCP ENVIRONMENT

316       Environment variables with the prefix PCP_ are used to parameterize the
317       file and directory names used by PCP.  On each installation,  the  file
318       /etc/pcp.conf  contains  the  local  values  for  these variables.  The
319       $PCP_CONF variable may be used to specify an alternative  configuration
320       file, as described in pcp.conf(5).
321
322       For environment variables affecting PCP tools, see pmGetOptions(3).
323

SEE ALSO

325       mkaf(1),  PCPIntro(1),  pcp(1),  pcp2elasticsearch(1), pcp2graphite(1),
326       pcp2influxdb(1),  pcp2xlsx(1),  pcp2xml(1),   pcp2zabbix(1),   pmcd(1),
327       pminfo(1),   pmrep(1),   pmGetOptions(3),  pmSpecLocalPMDA(3),  pmLoad‐
328       DerivedConfig(3),   pmParseUnitsStr(3),   pmRegisterDerived(3),   LOGA‐
329       RCHIVE(5), pcp.conf(5), pmns(5), pmrep.conf(5) and environ(7).
330
331
332
333Performance Co-Pilot                  PCP                          PCP2JSON(1)
Impressum