1PCP2ZABBIX(1) General Commands Manual PCP2ZABBIX(1)
2
3
4
6 pcp2zabbix - pcp-to-zabbix metrics exporter
7
9 pcp2zabbix [-CGHIjlLnrRvV?] [-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 send-interval] [-g
12 server] [-h host] [-i instances] [-J rank] [-K spec] [-N predicate] [-O
13 origin] [-p port] [-P|-0 precision] [-q|-Q count-scale] [-s samples]
14 [-S starttime] [-t interval] [-T endtime] [-x prefix] [-X hostname]
15 [-y|-Y time-scale] metricspec [...]
16
18 pcp2zabbix is a customizable performance metrics exporter tool from PCP
19 to Zabbix. 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 pcp2zabbix is a close relative of pmrep(1). Please refer to pmrep(1)
24 for the metricspec description accepted on pcp2zabbix command line and
25 pmrep.conf(5) for description of the pcp2zabbix.conf configuration file
26 overall syntax, this page describes pcp2zabbix specific options and
27 configuration file differences with pmrep.conf(5). pmrep(1) also lists
28 some usage examples of which most are applicable with pcp2zabbix as
29 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 pcp2zabbix 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 pcp2zabbix specific options
51 zabbix_server (string)
52 Hostname or IP address of Zabbix server to send the metrics to. If
53 a host is monitored by a proxy, proxy hostname or IP address should
54 be used instead. Corresponding command line option is -g. Default
55 is localhost.
56
57 zabbix_port (integer)
58 Specify port number of server trapper running on the server. Cor‐
59 responding command line option is -p. Default is 10051.
60
61 zabbix_host (string)
62 Specify agent hostname as registered in Zabbix frontend. Host IP
63 address and DNS name will not work. Corresponding command line
64 option is -X. Defaults to the metrics source host.
65
66 zabbix_interval (string)
67 Indicates the interval to send the metrics to the Zabbix server.
68 This can be longer than the generic interval to minimize the over‐
69 head when communicating with the server (as each send creates a new
70 connection). Follows the time syntax described in PCPIntro(1).
71 Corresponding command line option is -E. Defaults to the generic
72 interval. Zabbix tools send at most 250 metrics at a time.
73 Ignored when reading metrics from PCP archives, in which case met‐
74 rics will be sent roughly at 250 metric batches.
75
76 zabbix_prefix (string)
77 Specify the prefix for metrics sent to the Zabbix server. Corre‐
78 sponding command line option is -x. Default is .pcp.
79
80 zabbix_lld (boolean)
81 Specify whether to enable Zabbix low-level discovery. Correspond‐
82 ing command line option is -l. Default is no.
83
85 The available command line options are:
86
87 -8 limit, --limit-filter=limit
88 Limit results to instances with values above/below limit. A posi‐
89 tive integer will include instances with values at or above the
90 limit in reporting. A negative integer will include instances
91 with values at or below the limit in reporting. A value of zero
92 performs no limit filtering. This option will not override possi‐
93 ble per-metric specifications. See also -J and -N.
94
95 -9 limit, --limit-filter-force=limit
96 Like -8 but this option will override per-metric specifications.
97
98 -a archive, --archive=archive
99 Performance metric values are retrieved from the set of Perfor‐
100 mance Co-Pilot (PCP) archive log files identified by the argument
101 archive, which is a comma-separated list of names, each of which
102 may be the base name of an archive or the name of a directory con‐
103 taining one or more archives.
104
105 --archive-folio
106 Read metric source archives from the PCP archive folio created by
107 tools like pmchart(1) or, less often, manually with mkaf(1).
108
109 -A align, --align=align
110 Force the initial sample to be aligned on the boundary of a natu‐
111 ral time unit align. Refer to PCPIntro(1) for a complete descrip‐
112 tion of the syntax for align.
113
114 -b scale, --space-scale=scale
115 Unit/scale for space (byte) metrics, possible values include
116 bytes, Kbytes, KB, Mbytes, MB, and so forth. This option will not
117 override possible per-metric specifications. See also pmParseU‐
118 nitsStr(3).
119
120 -B scale, --space-scale-force=scale
121 Like -b but this option will override per-metric specifications.
122
123 -c config, --config=config
124 Specify the config file to use. The default is the first found
125 of: ./pcp2zabbix.conf, $HOME/.pcp2zabbix.conf, $HOME/pcp/pcp2zab‐
126 bix.conf, and $PCP_SYSCONF_DIR/pcp2zabbix.conf. For details, see
127 the above section and pmrep.conf(5).
128
129 --container
130 Fetch performance metrics from the specified container, either
131 local or remote (see -h).
132
133 -C, --check
134 Exit before reporting any values, but after parsing the configura‐
135 tion and metrics and printing possible headers.
136
137 --daemonize
138 Daemonize on startup.
139
140 -e derived, --derived=derived
141 Specify derived performance metrics. If derived starts with a
142 slash (``/'') or with a dot (``.'') it will be interpreted as a
143 derived metrics configuration file, otherwise it will be inter‐
144 preted as comma- or semicolon-separated derived metric expres‐
145 sions. For details see pmLoadDerivedConfig(3) and pmRegister‐
146 Derived(3).
147
148 -E interval, --zabbix-interval=interval
149 Specify the interval to send metrics to the server. See zab‐
150 bix_interval description above for details.
151
152 -g server, --zabbix-server=server
153 Zabbix server to send the metrics to.
154
155 -G, --no-globals
156 Do not include global metrics in reporting (see pmrep.conf(5)).
157
158 -h host, --host=host
159 Fetch performance metrics from pmcd(1) on host, rather than from
160 the default localhost.
161
162 -H, --no-header
163 Do not print any headers.
164
165 -i instances, --instances=instances
166 Report only the listed instances from current instances (if
167 present, see also -j). By default all instances, present and
168 future, are reported. This is a global option that is used for
169 all metrics unless a metric-specific instance definition is pro‐
170 vided as part of a metricspec. By default single-valued ``flat''
171 metrics without multiple instances are still reported as usual,
172 use -v to change this. Please refer to pmrep(1) for more details
173 on this option.
174
175 -I, --ignore-incompat
176 Ignore incompatible metrics. By default incompatible metrics
177 (that is, their type is unsupported or they cannot be scaled as
178 requested) will cause pcp2zabbix to terminate with an error mes‐
179 sage. With this option all incompatible metrics are silently
180 omitted from reporting. This may be especially useful when
181 requesting non-leaf nodes of the PMNS tree for reporting.
182
183 -l, --zabbix-lld
184 Add low-level discovery (LLD) metrics. This allows PCP metric
185 instance domains to be sent to Zabbix, so that prototype
186 items/triggers/graphs may be automatically constructed by Zabbix.
187 For each PCP metric with an instance domain, the key
188 pcp.discovery[pcp.met.ric] is sent periodically. This symbol
189 should be added to a discovery rule, and will define the
190 {#PCP.MET.RIC} LLD macro. This macro can inturn be used to define
191 prototype items/triggers/graphs. The names are adjusted if -x was
192 given to override the pcp. prefix.
193
194 -j, --live-filter
195 Perform instance live filtering. This allows capturing all fil‐
196 tered instances even if processes are restarted at some point (un‐
197 like without live filtering). Doing live filtering over a huge
198 amount of instances naturally comes with some overhead so a bit of
199 user caution is advised.
200
201 -J rank, --rank=rank
202 Limit results to highest/lowest rank instances of set-valued met‐
203 rics. A positive integer will include highest valued instances in
204 reporting. A negative integer will include lowest valued in‐
205 stances in reporting. A value of zero performs no ranking. See
206 also -8.
207
208 -K spec, --spec-local=spec
209 When fetching metrics from a local context (see -L), the -K option
210 may be used to control the DSO PMDAs that should be made accessi‐
211 ble. The spec argument conforms to the syntax described in pm‐
212 SpecLocalPMDA(3). More than one -K option may be used.
213
214 -L, --local-PMDA
215 Use a local context to collect metrics from DSO PMDAs on the local
216 host without PMCD. See also -K.
217
218 -n, --invert-filter
219 Perform ranking before live filtering. By default instance live
220 filter filtering (when requested, see -j) happens before instance
221 ranking (when requested, see -J). With this option the logic is
222 inverted and ranking happens before live filtering.
223
224 -N predicate, --predicate=predicate
225 Specify a comma-separated list of predicate filter reference met‐
226 rics. By default ranking (see -J) happens for each metric indi‐
227 vidually. With predicate filter reference metrics, ranking is
228 done only for the specified metrics. When reporting, the rest of
229 the metrics sharing the same instance domain (see PCPIntro(1)) as
230 the predicates will include only the highest/lowest ranking in‐
231 stances of the corresponding predicates.
232
233 So for example, when the using proc.memory.rss (resident size of
234 process) as the predicate and including proc.io.total_bytes and
235 mem.util.used as metrics to be reported, only the processes using
236 most/least memory (as per -J) will be included when reporting to‐
237 tal bytes written by processes. Since mem.util.used is a single-
238 valued metric (thus not sharing the same instance domain as the
239 process-related metrics), it will be reported as usual.
240
241 -O origin, --origin=origin
242 When reporting archived metrics, start reporting at origin within
243 the time window (see -S and -T). Refer to PCPIntro(1) for a com‐
244 plete description of the syntax for origin.
245
246 -p port, --zabbix-port=port
247 Zabbix server port number.
248
249 -P precision, --precision=precision
250 Use precision for numeric non-integer output values. The default
251 is to use 3 decimal places (when applicable). This option will
252 not override possible per-metric specifications.
253
254 -0 precision, --precision-force=precision
255 Like -P but this option will override per-metric specifications.
256
257 -q scale, --count-scale=scale
258 Unit/scale for count metrics, possible values include count x
259 10^-1, count, count x 10, count x 10^2, and so forth from 10^-8 to
260 10^7. (These values are currently space-sensitive.) This option
261 will not override possible per-metric specifications. See also
262 pmParseUnitsStr(3).
263
264 -Q scale, --count-scale-force=scale
265 Like -q but this option will override per-metric specifications.
266
267 -r, --raw
268 Output raw metric values, do not convert cumulative counters to
269 rates. This option will override possible per-metric specifica‐
270 tions.
271
272 -R, --raw-prefer
273 Like -r but this option will not override per-metric specifica‐
274 tions.
275
276 -s samples, --samples=samples
277 The argument samples defines the number of samples to be retrieved
278 and reported. If samples is 0 or -s is not specified, pcp2zabbix
279 will sample and report continuously (in real time mode) or until
280 the end of the set of PCP archives (in archive mode). See also
281 -T.
282
283 -S starttime, --start=starttime
284 When reporting archived metrics, the report will be restricted to
285 those records logged at or after starttime. Refer to PCPIntro(1)
286 for a complete description of the syntax for starttime.
287
288 -t interval, --interval=interval
289 The default update interval may be set to something other than the
290 default 1 second. The interval argument follows the syntax de‐
291 scribed in PCPIntro(1), and in the simplest form may be an un‐
292 signed integer (the implied units in this case are seconds). See
293 also the -T option.
294
295 -T endtime, --finish=endtime
296 When reporting archived metrics, the report will be restricted to
297 those records logged before or at endtime. Refer to PCPIntro(1)
298 for a complete description of the syntax for endtime.
299
300 When used to define the runtime before pcp2zabbix will exit, if no
301 samples is given (see -s) then the number of reported samples de‐
302 pends on interval (see -t). If samples is given then interval
303 will be adjusted to allow reporting of samples during runtime. In
304 case all of -T, -s, and -t are given, endtime determines the actu‐
305 al time pcp2zabbix will run.
306
307 -v, --omit-flat
308 Omit single-valued ``flat'' metrics from reporting, only consider
309 set-valued metrics (i.e., metrics with multiple values) for re‐
310 porting. See -i and -I.
311
312 -V, --version
313 Display version number and exit.
314
315 -x prefix, --zabbix-prefix=prefix
316 Metrics prefix for measurements sent to the server.
317
318 -X hostname, --zabbix-host=hostname
319 Specify the agent hostname as registered in Zabbix frontend.
320
321 -y scale, --time-scale=scale
322 Unit/scale for time metrics, possible values include nanosec, ns,
323 microsec, us, millisec, ms, and so forth up to hour, hr. This op‐
324 tion will not override possible per-metric specifications. See
325 also pmParseUnitsStr(3).
326
327 -Y scale, --time-scale-force=scale
328 Like -y but this option will override per-metric specifications.
329
330 -?, --help
331 Display usage message and exit.
332
334 pcp2zabbix.conf
335 pcp2zabbix configuration file (see -c)
336
338 Environment variables with the prefix PCP_ are used to parameterize the
339 file and directory names used by PCP. On each installation, the file
340 /etc/pcp.conf contains the local values for these variables. The
341 $PCP_CONF variable may be used to specify an alternative configuration
342 file, as described in pcp.conf(5).
343
344 For environment variables affecting PCP tools, see pmGetOptions(3).
345
347 mkaf(1), PCPIntro(1), pcp(1), pcp2elasticsearch(1), pcp2graphite(1),
348 pcp2influxdb(1), pcp2json(1), pcp2xlsx(1), pcp2xml(1), pmcd(1), pmin‐
349 fo(1), pmrep(1), pmGetOptions(3), pmSpecLocalPMDA(3), pmLoadDerivedCon‐
350 fig(3), pmParseUnitsStr(3), pmRegisterDerived(3), zbxpcp(3), LOGA‐
351 RCHIVE(5), pcp.conf(5), pmns(5) and pmrep.conf(5).
352
353
354
355Performance Co-Pilot PCP PCP2ZABBIX(1)