NAME |C SYNOPSIS |DESCRIPTION |CAVEAT |DIAGNOSTICS |SEE ALSO |COLOPHON | |
PMDACONNECT(3) Library Functions ManualPMDACONNECT(3)pmdaConnect- establish a connection between a daemon PMDA and PMCD
#include <pcp/pmapi.h>#include <pcp/pmda.h>void pmdaConnect(pmdaInterface *dispatch);cc ... -lpcp_pmda -lpcp
pmdaConnectinitializes an IPC channel between aPMDA(3) and thepmcd(1) process on the local host. The type of the connection is dependent on thee_io field of thepmdaExtstructure:pmdaPipe Usestdin/stdoutto communicate; assumes this is a pipe created bypmcdbefore thePMDA(3) was launched.pmdaInet Assumepmcd(1) will establish a connection to an IPv4 in‐ ternet domain socket set up by thePMDA(3). The name or number of the port must be specified in thee_sockname ore_port fields of thepmdaExtstructure, respectively.pmdaIPv6 Assumepmcd(1) will establish a connection to an IPv6 in‐ ternet domain socket set up by thePMDA(3). The name or number of the port must be specified in thee_sockname ore_port fields of thepmdaExtstructure, respectively.pmdaUnix Assumepmcd(1) will establish a connection to a unix domain socket set up by thePMDA(3). The port number must be specified in thee_port field of thepmdaExt structure.pmdaUnknown The initial value ofe_io which defaults to usingstdin/stdout. The relevantpmdaExtfields are initialized bypmdaDaemon(3) and set bypmdaGetOpt(3) orpmdaGetOptions(3) so most PMDAs should not need to access or modify them. Traditionally most PMDAs have calledpmdaConnectafter calls topmdaDaemon(3),pmdaGetOptions(3) (orpmdaGetOpt(3)) andpmdaInit(3). If the PMDA requires significant processing at startup to identify the available metrics and/or instance domains beforepmdaInit(3) can be called, then it risks timing out during the handshake protocol that starts as soon aspmcd(1) launches the PMDA and does not conclude untilpmdaConnectis called. In this case, it is advisable to move thepmdaConnectcall, so that it comesafter the call topmdaGetOptions(3) (orpmdaGetOpt(3)) andbefore the call topmdaInit(3).
The PMDA must be usingPMDA_INTERFACE_2or later, as specified in the call topmdaDaemon(3).
pmdaConnectwill log the type of connection made topmcd(1) if thePMAPI(3) debugging optionlibpmdahas been set in the global de‐ bugging specification, as described inpmSetDebug(3). If an error occurs that is unrecoverable,dispatch->status is set to a value less than 0, otherwise it is zero or positive.
pmcd(1),pipe(2),socket(2),PMAPI(3),PMDA(3),pmdaDaemon(3),pmdaGetOpt(3),pmdaGetOptions(3) andpmdaInit(3).
This page is part of thePCP (Performance Co-Pilot) project. In‐ formation about the project can be found at ⟨http://www.pcp.io/⟩. If you have a bug report for this manual page, send it to pcp@groups.io. This page was obtained from the project's upstream Git repository ⟨https://github.com/performancecopilot/pcp.git⟩ on 2025-08-11. (At that time, the date of the most recent commit that was found in the repository was 2025-08-11.) If you discover any rendering problems in this HTML version of the page, or you believe there is a better or more up-to-date source for the page, or you have corrections or improvements to the information in this COLOPHON (which isnot part of the original manual page), send a mail to man-pages@man7.orgPerformance Co-Pilot PCPPMDACONNECT(3)Pages that refer to this page:pmda(3)
HTML rendering created 2025-09-06 byMichael Kerrisk, author ofThe Linux Programming Interface. For details of in-depthLinux/UNIX system programming training courses that I teach, lookhere. Hosting byjambit GmbH. | ![]() |