|  | Home · Charts · Time Control

# Archive log management

    Tools
    pmlc
    pmafm
    pmlogger
    pmdumplog
    mpvis
    mkaf

This chapter of the Performance Co-Pilot tutorial covers PCP tools for creating and managing PCP archive logs.

For an explanation of Performance Co-Pilot terms and acronyms, consult the PCP glossary.

- Overview
- Primary Logger
- Other Logger Instances
- Creating and Replaying PCP Archive Logs
- PCP Archive Folios
- Controlling pmlogger
- Management of PCP Archives

Overview

The Performance Co-Pilot includes many facilities for creating and replaying archive logs that capture performance information.

For all PCP monitoring tools, metrics values may come from a real-time feed (i.e. from pmcd on some host), or from an archive log.

Users have complete control of what metrics are collected, how often and in which logs. These decisions can be changed dynamically.

Primary Logger

The primary instance of the PCP archive logger (pmlogger) may be started on a collector system each time pmcd is started.

This action is controlled by the chkconfig option `pmlogger'. To turn it on, as root do the following:

`# chkconfig pmlogger on`
`# $PCP_RC_DIR/pcp start`

The specification for hosts to log, and pmlogger options is given in the $PCP_PMLOGGERCONTROL_PATH file, and (optionally) files in the $PCP_PMLOGGERCONTROL_PATH.d directory.

This has a default entry for the local host, which specifies the metrics to be logged, and the frequency of logging - by default, using the file $PCP_VAR_DIR/config/pmlogger/config.default.

Other Logger Instances

Additional instances of pmlogger may be started at any time, running on either a collector system or a monitor system.

In all cases, each pmlogger instance will create an archive log for metrics from a single collector system.

The initial specification of what to log is given in a configuration file; the syntax is fully described in the pmlogger(1) man page.

Creating and Replaying PCP Archive Logs

Some configuration files are supplied, e.g. to create archive logs suitable for the PCP visualization tools. These may be found in the directory $PCP_VAR_DIR/config/pmlogger.

A simple example has been provided to illustrate the creation of an archive log, and subsequent playback using mpvis. (All of the PCP monitoring tools accept the command line arguments -a `archivename` to replay from an archive).

In a command shell enter:
    $ source /etc/pcp.conf
    $ cd /tmp
    $ rm -f myarchive.*
    $ $PCP_BINADM_DIR/pmlogger -T 30sec -t 1sec \
            -c $PCP_VAR_DIR/config/pmlogger/config.mpvis myarchive
    $ ls myarchive.*
    $ mpvis -a myarchive

- This starts pmlogger with localhost as the default host from which metrics will be fetched, a logging duration of 30 seconds, a logging interval of 1 second, a configuration from the $PCP_VAR_DIR/config/pmlogger/config.mpvis file, and myarchive as the base name of the output archive.
- Once the archive has been created, the directory listing of myarchive.* shows that the archive log created by pmlogger is composed of 3 files.
- When mpvis starts up, click the left mouse button on the Play button in the PCP Archive Time Control dialog. mpvis will start replaying values from the archive at the same speed at which they were recorded.
- Double click the left mouse button on the Play button in the PCP Archive Time Control dialog. mpvis should now replay the values in a Fast Forward mode until it reaches the end of the archive.
- Select the Options->Show Bounds option from the PCP Archive Time Control dialog menu bar. The exposed Archive Time Bounds dialog displays the bounds of the archive. Another way to look at the bounds of the archive is by using pmdumplog:

          $ pmdumplog -L myarchive

  For more information on pmdumplog refer to the pmdumplog(1) man page.

Archive Folios

An archive folio is a named collection of PCP archives. These are typically used to provide a convenient way of processing multiple, correlated PCP archives.

Archive folios are created with mkaf.

The contents of an archive folio can be processed using the pmafm utility.

A simple example has been provided to illustrate the creation and subsequent processing of a folio.

In a command shell enter:
    $ source /etc/pcp.conf
    $ cd /tmp
    $ tar xzf $PCP_DEMOS_DIR/tutorials/pmie.tar.gz
    $ tar xzf $PCP_DEMOS_DIR/tutorials/cpuperf.tar.gz
    $ $PCP_BINADM_DIR/mkaf pmie/babylon.perdisk.0 \
    	cpuperf/babylon.percpu.0 > myfolio
    $ pmafm myfolio list
    $ pmafm myfolio pmdumplog -l

- The mkaf creates a folio called myfolio which includes the archives babylon.percpu and babylon.perdisk. Note that the archives are not changed in any way, and a new archive is not created.
- The pmafm tool may now be used to perform different operations on the folio myfolio, such as listing the folio contents, or using other tools to open the archive logs contained in the folio. If pmafm is given a folio name but no arguments, it will run in interactive mode.

For more information on folios refer to the mkaf(1) and pmafm(1) man pages.

Controlling pmlogger

The pmlc utility may be used to interrogate any pmlogger instance running either locally or remotely. Use pmlc to

- add or delete metrics or metric instances to be logged
- change the logging frequency for selected metrics

The line-oriented command interface to pmlc(1) is fully described in the man page.

Management of PCP Archives

PCP includes a suite of scripts and tools to automate the collection and management of archives.

Briefly, these facilities include:

- daily log rotation (pmlogger_daily(1))
- archive log merging (pmlogextract(1))
- automatic restarting of failed pmlogger instances (pmlogger_check(1))
- creation of snapshots from archives (pmsnap(1))
- maintenance of archive folios for active archives (mkaf(1) and pmafm(1))

Copyright © 2007-2010 Aconex Copyright © 2000-2004 Silicon Graphics Inc | PCP Site Copyright © 2012-2018 Red Hat