NAME
pmdaGetOpt, pmdaGetOptions - get options from arguments, parsing generic PMDA optionsC SYNOPSIS
#include <pcp/pmapi.h>int pmdaGetOptions(int argc, char *const *argv, pmdaOptions *opts, pmdaInterface * dispatch);
int pmdaGetOpt(int argc, char *const *argv, const char * optstring, pmdaInterface *dispatch, int * err);
cc ... -lpcp_pmda -lpcp
DESCRIPTION
These functions are wrappers for pmgetopt_r(3). The behavior of each function is that certain options are assumed to have a predefined behavior which initializes several fields in the pmdaInterface structure. The pmdaGetOptions interface allows both short and long options to be given, whereas pmdaGetOpt allows for short form options only. The options that both pmdaGetOptions and pmdaGetOpt will trap are:- -Ddebugspec
- Set the PMAPI(3) debugging options to debugspec, as described in PCPIntro(1). Used for controlling levels of trace output while debugging.
- -ddomain
- Set the domain number of this agent.
- -hhelpfile
- Obtain the help text (see pmdaText(3)) for the metrics from this file rather than from the path specified with pmdaDSO(3) or pmdaDaemon(3).
- -iport
- Expect PMCD to connect on inet port (number or name).
- -6port
- Expect PMCD to connect on ipv6 port (number or name).
- -llogfile
- Redirect diagnostics and trace output to logfile.
- -p
- Expect PMCD to supply stdin/stdout pipe.
- -usocket
- Expect PMCD to connect on unix domain socket.
- -Uusername
- Set the user account name under which the PMDA should execute.
CAVEAT
The options -D, -d, -i, -l, -p and -u cannot be reused for other purposes by the PMDA, unless using the override method provided by the pmdaGetOptions interface, which operates in the same way as described for the pmGetOptions(3) interface used by PMAPI client tools. The PMDA must be using PMDA_INTERFACE_2 or later, as specified in the call to pmdaDSO(3) or pmdaDaemon(3).DIAGNOSTICS
Both pmdaGetOptions and pmdaGetOpt will display the same error messages as getopt.SEE ALSO
pmdbg(1), getopt(3), pmgetopt_r(3), pmGetOptions(3), PMAPI(3), PMDA(3), pmdaDaemon(3), pmdaDSO(3) and pmdaText(3).PCP | Performance Co-Pilot |