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