File: pmproxy.1

package info (click to toggle)
pcp 6.3.8-1
  • links: PTS
  • area: main
  • in suites: forky, sid, trixie
  • size: 235,180 kB
  • sloc: ansic: 1,253,622; sh: 173,998; xml: 160,490; cpp: 83,331; python: 20,482; perl: 18,302; yacc: 6,886; makefile: 2,955; lex: 2,862; fortran: 60; java: 52
file content (538 lines) | stat: -rw-r--r-- 15,398 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
'\"macro stdmacro
.\"
.\" Copyright (c) 2013-2015,2018-2019,2021-2023 Red Hat.
.\" Copyright (c) 2000 Silicon Graphics, Inc.  All Rights Reserved.
.\"
.\" This program is free software; you can redistribute it and/or modify it
.\" under the terms of the GNU General Public License as published by the
.\" Free Software Foundation; either version 2 of the License, or (at your
.\" option) any later version.
.\"
.\" This program is distributed in the hope that it will be useful, but
.\" WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
.\" or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
.\" for more details.
.\"
.\"
.TH PMPROXY 1 "PCP" "Performance Co-Pilot"
.SH NAME
\f3pmproxy\f1 \- proxy for performance metrics collector and querying
.SH SYNOPSIS
\f3pmproxy\f1
[\f3\-AdfFt?\f1]
[\f3\-c\f1 \f2conffile\f1]
[\f3\-h\f1 \f2host\f1[,\f2host\f1 ...]
[\f3\-i\f1 \f2ipaddress\f1]
[\f3\-l\f1 \f2logfile\f1]
[\f3\-L\f1 \f2bytes\f1]
[\f3\-p\f1 \f2port\f1[,\f2port\f1 ...]
[\f3\-r\f1 \f2port\f1[,\f2port\f1 ...]
[\f3\-s\f1 \f2sockname\f1]
[\f3\-U\f1 \f2username\f1]
[\f3\-x\f1 \f2outfile\f1]
.SH DESCRIPTION
.B pmproxy
acts as a protocol proxy,
allowing Performance Co-Pilot (PCP) monitoring clients to connect to
one or more
.BR pmcd (1)
and/or key-value servers (such as \c
.BR https://valkey.io/ )
indirectly.
.PP
In its default mode of operation
.B pmproxy
provides the REST API for PCP services (see
.BR PMWEBAPI (3)
for details).
This includes provision of an Open Metrics -
.I https://openmetrics.io
- text interface for PCP metrics at
.IR /metrics ,
real-time access to PCP metrics through the
.I /pmapi
interfaces,
and access to the fast, scalable PCP time series query
capabilities offered in conjunction with a key-value
server (see
.BR pmseries (1)
for details) via the
.I /query
REST interfaces.
.PP
.B pmproxy
can be deployed in a firewall domain, or on a cluster ``head'' node
where the IP (Internet Protocol) address of the hosts where
.B pmcd
and/or a key-value server (such as
.BR https://valkey.io/ )
are running may be unknown to the PCP monitoring clients, but where
the IP address of the host running
.B pmproxy
is known to these clients.
Similarly, the clients may have network connectivity only to the
host where
.B pmproxy
is running, while there is network connectivity from that host to the
hosts of interest where
.B pmcd
and/or a key-value server are running.
.PP
The behaviour of the PCP monitoring clients is controlled by either the
.B PMPROXY_HOST
environment variable or through the extended hostname specification
(see
.BR PCPIntro (1)
for details).
If neither of these mechanisms is used, clients will make their
.BR PMAPI (3)
connections directly to
.BR pmcd .
If the proxy hostname syntax is used or
.B PMPROXY_HOST
is set, then this should be the hostname or IP address of the system
where
.B pmproxy
is running, and the clients will connect to
.B pmcd
or a key-value server indirectly through the protocol proxy services of
.BR pmproxy.
.SH OPTIONS
The available command line options are:
.TP 5
.B \-A
Disable service advertisement.
By default,
.B pmproxy
will advertise its presence on the network using any available mechanisms
(such as Avahi/DNS-SD), assisting remote monitoring tools with finding it.
These mechanisms are disabled with this option.
.TP
\f3\-c\f1 \f2conffile\f1, \f3\-\-config\f1=\f2conffile\f1
Specify the path to an optional configuration
.IR conffile ,
with format as described in the ``CONFIGURATION'' section.
This option implies \f3pmproxy\f1 is running in \f3timeseries\f1 mode.
.TP
\f3\-d\f1, \f3\-\-deprecated\f1
By default
.B pmproxy
prefers to run in the new \f3timeseries\f1 mode, providing REST APIs,
asynchronous network I/O, scalable time series, and secure connections
using OpenSSL.
However, legacy deployments may wish to use the original synchronous
.B pmproxy
implementation using libpcp networking; this can be achieved using
this option.
Note that the \f3\-d\f1 and \f3\-t\f1 options are mutually exclusive.
.TP
\f3\-f\f1, \f3\-\-foreground\f1
By default
.B pmproxy
is started as a daemon.
The
.B \-f
option indicates that it should run in the foreground.
This is most useful when trying to diagnose problems with establishing
connections.
.TP
\f3\-F\f1, \f3\-\-systemd\f1
Like
.BR \-f ,
the
.B \-F
option runs
.B pmproxy
in the foreground, but also does some housekeeping (like create a
``pid'' file and change user id).  This is intended for use when
.B pmproxy
is launched from
.BR systemd (1)
and the daemonising has already been done by
.BR systemd (1)
and does not need to be done again by
.BR pmproxy ,
which is the case when neither
.B \-f
nor
.B \-F
is specified.
.RS +5n
.PP
At most one of
.B \-f
and
.B \-F
may be specified.
.RE
.TP
\f3\-h\f1 \f2host\f1, \f3\-\-keyhost\f1=\f2host\f1
Specify an alternate key-value server
.I host
to connect to for time series querying, overriding any configuration
file settings.
This option implies \f3pmproxy\f1 is running in \f3timeseries\f1 mode.
.TP
\f3\-i\f1 \f2ipaddress\f1, \f3\-\-interface\f1=\f2ipaddress\f1
This option is usually only used on hosts with more than one network
interface (very common for firewall and ``head'' node hosts where
.B pmproxy
is likely to be deployed to arbitrate access to an internal network).
If no
.B \-i
options are specified
.B pmproxy
accepts PCP client connections on any of its host's IP addresses.
The
.B \-i
option is used to specify explicitly an IP address that PCP client connections should be
accepted on.
.I ipaddress
should be in the standard dotted form (e.g. 100.23.45.6).
The
.B \-i
option may be used multiple times to define a list of IP addresses.
When one or more
.B \-i
options is specified, attempted connections made on any other IP addresses will be refused.
.TP
\f3\-l\f1 \f2logfile\f1, \f3\-\-log\f1=\f2logfile\f1
By default a log file named
.I pmproxy.log
is written in the current directory.
The
.B \-l
option causes the log file to be written to a given
.I logfile
instead of the default.
If this
.I logfile
cannot be created or is not writable, output is
written to the standard error instead.
.TP
\f3\-L\f1 \f2bytes\f1
.IR PDU s
received by
.B pmproxy
from PCP monitoring clients are restricted to a
maximum size of 65536 bytes by default to defend against Denial of
Service attacks.
The
.B \-L
option may be used to change the maximum incoming
.I PDU
size.
.TP
\f3\-p\f1 \f2port\f1, \f3\-\-port\f1=\f2port\f1
Specify an alternate
.I port
number to listen on for client connections.
The default value is 44322.
.TP
\f3\-r\f1 \f2port\f1, \f3\-\-keyport\f1=\f2port\f1
Specify an alternate key-value server
.I port
number to connect to for time series querying, overriding any
configuration file settings.
This option implies \f3pmproxy\f1 is running in \f3timeseries\f1 mode.
.TP
\f3\-s\f1 \f2sockname\f1, \f3\-\-socket\f1=\f2sockname\f1
Specify the path to a local unix domain socket (for platforms supporting this
socket family only).
The default value is
.IR $PCP_RUN_DIR/pmproxy.socket .
This option implies \f3pmproxy\f1 is running in \f3timeseries\f1 mode.
.TP
\fB\-t\f1, \fB\-\-timeseries\f1
Operate in automatic archive timeseries discovery mode.
This mode of operation will enable the
.BR PMWEBAPI (3)
REST APIs, dynamically and automatically detect active system
archives being written by
.BR pmlogger (1)
and import them into a key-value server (such as
.BR https://valkey.io/ ),
for fast, scalable time series querying described in
.BR pmseries (1).
Note that in this mode of operation,
.B pmproxy
only "log-tails" and ingests actively growing archives, e.g. as written by one or more
.BR pmlogger (1)
instances.
When an archive is first discovered (usually but not limited to
.B pmproxy
startup),
all metadata is loaded and sent to the configured key-value server
however note that only
.B new
archive metric value data from the tail end of each archive is ingested.
Compressed archives never grow and so are ignored.
See the
.B \-\-load
option to
.BR pmseries (1)
for a supported mechanism for manually loading all of the metric value data
from previously collected (inactive) archives,
whether compressed or not.
It would be normal, though not mandated, for a set of archives being manually loaded
to cover the same time period, e.g. archive data for a particular week for one or more
hosts in the same data-centre.
.TP
\f3\-U\f1 \f2username\f1, \f3\-\-username\f1=\f2username\f1
Assume the identity of the given
.I username
before starting to accept incoming packets from PCP monitoring clients.
.TP
\f3\-x\f1 \f2outfile\f1
Before the
.B pmproxy
.I logfile
can be opened,
.B pmproxy
may encounter a fatal error which prevents it from starting.
By default the output describing this error is sent to
.B /dev/tty
but it may redirected to
.IR outfile .
.TP
\fB\-?\fR, \fB\-\-help\fR
Display usage message and exit.
.SH CONFIGURATION
When running in the \f3timeseries\f1 mode of operation, runtime
configuration is relatively complex and typically handled via the
.I $PCP_SYSCONF_DIR/pmproxy/pmproxy.conf
file.
This file is in the common ``ini'' format, with section headers
and individual variables and values with each section.
The configuration file installed as part of PCP documents
every available section and option.
.PP
At a high level, the
.I [pmproxy]
section can be used to explicitly enable or disable each of the
different protocols.
.PP
The
.I [keys]
section allows connection information for one or more backing
key-value server processes to be configured (hostnames and ports).
Note to access multiple (scalable) key-value servers, the
.I servers
variable in this section can be a comma-separated list of
hostname:port pairs.
Alternatively, it can be a single key-value server host
that will be queried using the "CLUSTER INFO" command to
automatically configure multiple backing hosts.
.PP
In earlier versions of PCP (before 6) an alternative configuration
setting section was used for this purpose \- key-value
.I servers
were specified in the
.I [pmseries]
section and this is still accepted as a fallback for backwards
compatibility.
.SH STARTING AND STOPPING PMPROXY
Normally,
.B pmproxy
is started automatically at boot time and stopped when the
system is being brought down.
Under certain circumstances it is necessary to start or stop
.B pmproxy
manually.
To do this one must become superuser and type
.PP
.ft CR
# $PCP_RC_DIR/pmproxy start
.ft 1
.PP
to start
.BR pmproxy ,
or
.PP
.ft CR
# $PCP_RC_DIR/pmproxy stop
.ft 1
.PP
to stop
.BR pmproxy .
Starting
.B pmproxy
when it is already running is the same as stopping
it and then starting it again.
.P
Normally
.B pmproxy
listens for PCP client connections on TCP/IP port number 44322
(as well as 44323 with \f3timeseries\f1 enabled) registered at
.BR https://www.iana.org/ .
Either the environment
variable
.B PMPROXY_PORT
or the
.B \-p
command line option may be used to specify alternative port
number(s) when
.B pmproxy
is started; in each case, the specification is a comma-separated list
of one or more numerical port numbers.
Should both methods be used or multiple
.B \-p
options appear on the command line,
.B pmproxy
will listen on the union of the set of ports specified via all
.B \-p
options and the
.B PMPROXY_PORT
environment variable.
If non-default ports are used with
.B pmproxy
care should be taken to ensure that
.B PMPROXY_PORT
is also set in the environment of any client application that
will connect to
.BR pmproxy ,
or that the extended host specification syntax is used
(see
.BR PCPIntro (1)
for details).
.SH DIAGNOSTICS
If
.B pmproxy
is already running the message "Error: OpenRequestSocket bind: Address already
in use" will appear.
This may also appear if
.B pmproxy
was shutdown with an outstanding request from a client.
In this case, a
request socket has been left in the TIME_WAIT state and until the system closes
it down (after some timeout period) it will not be possible to run
.BR pmproxy .
.PP
In addition to the standard
.B PCP
debugging options, see
.BR pmdbg (1),
.B pmproxy
currently supports the debugging option
.B context
for tracing client connections and disconnections.
.SH FILES
.TP 5
.I $PCP_PMPROXYOPTIONS_PATH
command line options for
.B pmproxy
when launched from
.B $PCP_RC_DIR/pmproxy
All the command line option lines should start with a hyphen as
the first character.
.TP
.I $PCP_SYSCONFIG_DIR/pmproxy
Environment variables that will be set when
.B pmproxy
executes.
Only settings of the form "PMPROXY_VARIABLE=value" will be honoured.
.TP
.I \&./pmproxy.log
(or
.B $PCP_LOG_DIR/pmproxy/pmproxy.log
when started automatically)
.br
All messages and diagnostics are directed here
.TP
.I /etc/pki/tls
default OpenSSL certificate database directory, optionally used for
Secure Socket Layer connection in \f3timeseries\f1 mode of operation.
These certificates can be created and queried using the
.B openssl
tool, amongst others.
.SH ENVIRONMENT
In addition to the PCP environment variables described in the
.B "PCP ENVIRONMENT"
section below, there are several environment variables that
influence the interactions between a PCP monitoring client,
.B pmproxy
and
.BR pmcd .
.TP
.B PMCD_PORT
For the PCP monitoring client this (or the default port number) is passed to
.B pmproxy
and used to connect to
.BR pmcd .
In the environment of
.B pmproxy
.B PMCD_PORT is not used.
.TP
.B PMPROXY_HOST
For the PCP monitoring client this is the hostname or IP address of the
host where
.B pmproxy
is running.
In recent versions of PCP (since version 3) this has been superseded by
the extended hostname syntax
(see
.BR PCPIntro (1)
for details).
.TP
.B PMPROXY_PORT
For the PCP monitoring client this is the port on which
.B pmproxy
will accept connections.
The default is 44322, as well as 44323 with \f3timeseries\f1 enabled.
.TP
.BR PMCD_CONNECT_TIMEOUT ", " PMCD_RECONNECT_TIMEOUT " and " PMCD_REQUEST_TIMEOUT
(see
.BR PCPIntro (1))
For the PCP monitoring client, setting these environment variables
will modify the timeouts used for interactions between the client
and
.BR pmproxy
(independent of which
.B pmcd
is being used).
For
.B pmproxy
these same environment variables control the timeouts between
.B pmproxy
and all
.BR pmcd (1)
instances (independent of which monitoring client is involved).
.PP
If set to the value 1, the
.B PMPROXY_LOCAL
environment variable will cause
.B pmproxy
to run in a localhost-only mode of operation, where it binds only
to the loopback interface.
.PP
The
.B PMPROXY_MAXPENDING
variable can be set to indicate the maximum length to which the queue
of pending client connections may grow.
.SH PCP ENVIRONMENT
Environment variables with the prefix \fBPCP_\fP are used to parameterize
the file and directory names used by PCP.
On each installation, the
file \fI/etc/pcp.conf\fP contains the local values for these variables.
The \fB$PCP_CONF\fP variable may be used to specify an alternative
configuration file, as described in \fBpcp.conf\fP(5).
.PP
For environment variables affecting PCP tools, see \fBpmGetOptions\fP(3).
.SH SEE ALSO
.BR PCPIntro (1),
.BR pmcd (1),
.BR pmdbg (1),
.BR pmlogger (1),
.BR pmseries (1),
.BR PMAPI (3),
.BR PMWEBAPI (3),
.BR pmGetOptions (3),
.BR pcp.conf (5)
and
.BR pcp.env (5).

.\" control lines for scripts/man-spell
.\" +ok+ Avahi OpenRequestSocket OpenSSL
.\" +ok+ PMPROXY PMPROXY_VARIABLE
.\" +ok+ SD {from DNS-SD} TIME_WAIT
.\" +ok+ openssl pki