введение в библиотеку поддержки агента домена Performance Metrics (introduction to the Performance Metrics Domain Agent support library)
INSTALLATION AND REMOVAL
A series of shell procedures are defined in
$PCP_SHARE_DIR/lib/pmdaproc.sh which greatly simplify the
installation and removal of a PMDA.
The Install scripts for most PMDAs should only need to specify
the name of the PMDA in iam
, call pmdaSetup
which sets up some
default variables, checks permissions (you have to be ``root'' to
install or remove a PMDA), checks that you're in the right
directory (somewhere that ends with /pmdas/$iam), optionally
generate the Performance Metrics Name Space (PMNS) and PMDA
domain number files for Perl or Python PMDAs, checks the PMDA
domain number is valid, etc., specify the communication
protocols, and finally call pmdaInstall
to do all the work of
updating the PMNS, updating the pmcd(1) control file, notifying
or restarting pmcd(1),
Beyond pmdaSetup
and pmdaInstall
, another optional helper
routines is pmdaChooseConfigFile
that may be used to
interactively select or create a PMDA-specific configuration
file, e.g. pmdalogger(1).
The Remove scripts are even simpler as setting up the
communication protocols are not required, so set the name of the
PMDA in iam, then call pmdaSetup
followed by a call to
pmdaRemove
.
Further information is contained in the
$PCP_SHARE_DIR/lib/pmdaproc.sh file and the following section.
Optionally, a PMDA may provide an Upgrade script alongside
Install and Remove. If present this script will be used by the
pmcd
startup process to ensure corrections to an installation
have been made before starting the PMDA. Examples of such
corrections include: updates to pmcd.conf when a PMDA script or
binary has been renamed, when the PMDA supports a new format of
its configuration file, or if there is some latent problem from
an earlier install (e.g. some PMDAs may need to introduce use of
the notready
keyword in pmcd.conf, as described below).