администрирование файлов журналов архива Performance Co-Pilot (administration of Performance Co-Pilot archive log files)
Конфигурация (Configuration)
Warning
: The $PCP_PMLOGGERCONTROL_PATH
file and files within the
$PCP_PMLOGGERCONTROL_PATH
.d directory must not be writable by any
user other than root.
The control file(s) should be customized according to the
following rules that define for the current version (1.1) of the
control file format.
1. Lines beginning with a ``#'' are comments. A special case is
lines beginning ``#!#''; these are control lines for a
pmlogger(1) that has been stopped using pmlogctl(1).
2. Lines beginning with a ``$'' are assumed to be assignments to
environment variables in the style of sh
(1), and all text
following the ``$'' will be eval
'ed by the script reading the
control file, and the corresponding variable exported into
the environment. This is particularly useful to set and
export variables into the environment of the administrative
scripts, e.g.
$ PMCD_CONNECT_TIMEOUT=20
3. There must
be a version line in the initial control file of
the form:
$ version=1.1
4. There should be one line in the control file(s) for each
pmlogger
instance of the form:
host y
|n y
|n
directory args
5. Fields within a line of the control file(s) are usually
separated by one or more spaces or tabs (although refer to
the description of the directory field for some important
exceptions).
6. The first field is the name of the host that is the source of
the performance metrics for this pmlogger
instance.
7. The second field indicates if this is a primary pmlogger
instance (y
) or not (n
). Since the primary logger must run
on the local host, and there may be at most one primary
logger for a particular host, this field can be y
for at most
one pmlogger
instance, in which case the host name must be
the name of the local host.
8. The third field indicates if this pmlogger
instance needs to
be started under the control of pmsocks(1) to connect to a
pmcd
through a firewall (y
or n
).
9. The fourth field is a directory name. All files associated
with this pmlogger
instance will be created in this
directory, and this will be the current directory for the
execution of any programs required in the maintenance of
those archives. A useful convention is that primary logger
archives for the local host with hostname myhost are
maintained in the directory $PCP_ARCHIVE_DIR/
myhost (this is
where the default pmlogger
start-up script in $PCP_RC_DIR/pcp
will create the archives), while archives for the remote host
mumble are maintained in $PCP_ARCHIVE_DIR/
mumble.
10. The directory field may contain embedded shell syntax that
will be evaluated by sh
(1) to produce the real directory name
to be used. The allowed constructs are:
• Any text (including white space) enclosed with $(
and ).
• Any text (including white space) enclosed with `
and `
(back quotes).
• Any text (including white space) enclosed with "
and "
(double quotes).
• Any word containing a $
(assumed to introduce an
environment variable name).
11. All other fields are interpreted as arguments to be passed to
pmlogger(1). Most typically this would be the -c
option.
The following sample control lines specify a primary logger on
the local host (bozo), and non-primary loggers to collect and log
performance metrics from the hosts wobbly and boing.
$version=1.1
bozo y n $PCP_ARCHIVE_DIR/bozo -c config.default
wobbly n n "/store/wobbly/$(date +%Y)" -c ./wobbly.config
boing n n $PCP_ARCHIVE_DIR/boing -c ./pmlogger.config
Typical crontab(5) entries for periodic execution of
pmlogger_daily
and pmlogger_check
are given in
$PCP_SYSCONF_DIR/pmlogger/crontab
(unless installed by default in
/etc/cron.d already) and shown below.
# daily processing of archive logs
14 0 * * * $PCP_BINADM_DIR/pmlogger_daily
# every 30 minutes, check pmlogger instances are running
25,55 * * * * $PCP_BINADM_DIR/pmlogger_check
When using systemd(1) on Linux, no crontab
entries are needed as
the timer mechanism provided by systemd
is used instead.