1PMCONNECTLOGGER(3) Library Functions Manual PMCONNECTLOGGER(3)
2
3
4
6 __pmConnectLogger - connect to a performance metrics logger control
7 port
8
10 #include <pcp/pmapi.h>
11 #include <pcp/impl.h>
12
13 int __pmConnectLogger(const char *hostname, int pid);
14
15 cc ... -lpcp
16
18 Each instance of the Performance Co-Pilot (PCP) archive logger program
19 pmlogger(1) supports a control port on which __pmControlLog(3) requests
20 are received, and responses sent. Optionally, the pmlogger(1) instance
21 may be designated the ``primary'' logger.
22
23 __pmConnectLogger may be used to establish a control port connection to
24 the pmlogger(1) instance identified by process id pid on the host host‐
25 name.
26
27 One special case is supported; for the reserved pid value of
28 PM_LOG_CONTROL_PORT the requested connection is to the control port for
29 the ``primary'' logger, whatever its process id might be.
30
31 On success, __pmConnectLogger returns a non-negative integer, that is a
32 file descriptor that may be used in subsequent communication with the
33 pmlogger(1) instance, e.g. for __pmControlLog(3).
34
35 As the control port to pmlogger(1) is not mulitplexed, applications
36 using __pmConnectLogger should use close(2) to terminate the connection
37 to pmlogger(1) as soon as they have finished communicating.
38
39 If the application connects, and the pmlogger(1) instance subsequently
40 terminates, e.g. because the associated pmcd(1) instance is terminated,
41 the application will have to explicitly re-establish connection to a
42 re-started pmlogger(1) instance by calling __pmConnectLogger again.
43
45 pmcd(1), pmlc(1), pmlogger(1), PMAPI(3) and __pmControlLog(3).
46
48 PM_ERR_PERMISSION
49 no permission to connect to the specified pmlogger(1) instance
50
51 -ECONNREFUSED
52 the designated pmlogger(1) instance does not exist
53
54 -EEADDRINUSE
55 the requested control port is already in use
56
57
58
59Performance Co-Pilot PCP PMCONNECTLOGGER(3)