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

NAME

6       pcp2graphite - pcp-to-graphite metrics exporter
7

SYNOPSIS

9       pcp2graphite   [-CGHIjLnrRvV?]    [-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] [-E text-port] [-g server]
12       [-h host] [-i instances] [-J rank] [-K spec] [-N predicate] [-O origin]
13       [-p pickle-port] [-P|-0 precision] [-q|-Q count-scale] [-s samples] [-S
14       starttime] [-t interval] [-T endtime] [-x prefix] [-X  pickle-protocol]
15       [-y|-Y time-scale] metricspec [...]
16

DESCRIPTION

18       pcp2graphite  is  a customizable performance metrics exporter tool from
19       PCP to Graphite.  Any available performance metric, live  or  archived,
20       system  and/or  application, can be selected for exporting using either
21       command line arguments or a configuration file.
22
23       pcp2graphite is a close relative of pmrep(1).  Please refer to pmrep(1)
24       for  the  metricspec  description accepted on pcp2graphite command line
25       and pmrep.conf(5) for description of the  pcp2graphite.conf  configura‐
26       tion  file  overall  syntax,  this page describes pcp2graphite specific
27       options  and  configuration  file   differences   with   pmrep.conf(5).
28       pmrep(1)  also  lists  some usage examples of which most are applicable
29       with pcp2graphite as well.
30
31       Only the command line options listed on this page are supported,  other
32       options recognized by pmrep(1) are not supported.
33
34       Options  via environment values (see pmGetOptions(3)) override the cor‐
35       responding  built-in  default  values  (if  any).   Configuration  file
36       options  override  the  corresponding  environment  variables (if any).
37       Command line options  override  the  corresponding  configuration  file
38       options (if any).
39

CONFIGURATION FILE

41       pcp2graphite uses a configuration file with overall syntax described in
42       pmrep.conf(5).  The following options are common with pmrep.conf:  ver‐
43       sion,  source,  speclocal, derived, header, globals, samples, interval,
44       type,  type_prefer,  ignore_incompat,  instances,  live_filter,   rank,
45       limit_filter,  limit_filter_force, invert_filter, predicate, omit_flat,
46       precision,     precision_force,     count_scale,     count_scale_force,
47       space_scale, space_scale_force, time_scale, time_scale_force.  The out‐
48       put option is recognized but ignored for pmrep.conf compatibility.
49
50   pcp2graphite specific options
51       graphite_host (string)
52           Hostname or IP address of Graphite server to send the  metrics  to.
53           Corresponding command line option is -g.  Default is localhost.
54
55       graphite_port (integer)
56           Specify port number of Graphite server (plaintext or pickle).  Cor‐
57           responding command line options are -p and -E.  Default is 2004.
58
59       pickle (boolean)
60           Specify whether to use pickle protocol.  Corresponding command line
61           options are -p and -E.  Default is yes.
62
63       pickle_protocol (integer)
64           Specify pickle protocol version.  Corresponding command line option
65           is -X.  Default is 0.
66
67       prefix (string)
68           Specify the prefix for metrics sent to the  server.   Corresponding
69           command line option is -x.  Default is pcp..
70

OPTIONS

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

FILES

312       pcp2graphite.conf
313              pcp2graphite 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),  pcp2influxdb(1),
326       pcp2json(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) and pmrep.conf(5).
330
331
332
333Performance Co-Pilot                  PCP                      PCP2GRAPHITE(1)
Impressum