pmlogconf — create/edit a pmlogger configuration file

Synopsis

pmlogconf [-cqrv?] [-d groupsdir] [-h host] configfile

Description

pmlogconf may be used to create and modify a generic configuration file for the PCP archive logger, pmlogger(1).

If configfile does not exist, pmlogconf will create a generic configuration file with a default set of enabled metrics and logging intervals.

Once created, configfile may be used with the -c option to pmlogger(1) to select performance metrics and specify logging intervals for a PCP archive.

If configfile does exist, pmlogconf will prompt for input from the user to enable or disable groups of related performance metrics and to control the logging interval for each enabled group.

Group selection requires a simple y (yes) or n (no) response to the prompt Log this group?.

Other responses at this point may be used to select additional control functions as follows:

m

Report the names of the metrics in the current group.

q

Finish with group selection (quit) and make no further changes to this group or any subsequent group.

/pattern

Make no change to this group but search for a group containing pattern in the description of the group or the names of the associated metrics.

A logging interval is specified by responding to the Logging interval? prompt with the keywords once or default or a valid pmlogger(1) interval specification of the form “every N timeunits” or simply “N timeunits ” (the every is optional) where N is an unsigned integer and timeunits is one of the keywords msec, millisecond, sec, second, min, minute, hour or the plural form of one of the keywords.

When run from automated logging setup processes, the -c option is used to indicate that pmlogconf is in auto-create mode and no interactive dialog takes place. The output configfile has an additional comment message and timestamp indicating this fact, so that it can be identified and subsequently updated using -c again. This option is not appropriate for interactive use of the tool.

The -q option suppresses the logging interval dialog and preserves the current interval from configfile.

More verbose output may be enabled with the -v option.

Setup Group Files

When an initial configfile is created, the default specifications come from a set of group files below the groupsdir specified with the -d option (the default groupsdir is $PCP_VAR_DIR/config/pmlogconf which is most commonly correct, so the -d option is rarely used in practice).

The directory structure below groupsdir is arbitrary as all regular files will be found by recursive descent and considered, so add-on products and PMDA developers can easily extend the available defaults to pmlogconf by adding new directories and/or group files below groupsdir.

These group files are processed in the following ways:

Each group file is structured as follows:

Probing is only done when a new group is being added to configfile or when the -r command line option is specified.  The evaluation of the probing conditions is done by contacting pmcd(1) on hostname (defaults to local:).

Options

The available command line options are:

-c

Enable non-interactive, auto-create mode.

-d groupdir, --groups=groupdir

Specify the path to the groupsdir directory.

-h host, --host=host

Performance metrics source is pmcd(1) on host, rather than on the default localhost.

-q, --quiet

Quiet mode, suppress logging interval dialog.

-r, --reprobe

Reconsider every group for inclusion in the configfile.

-v, --verbose

Enable verbose mode.

-?, --help

Display usage message and exit.

Example

The following group file demonstrates all of the supported syntactic elements.

#pmlogconf-setup 2.0
ident   Example group file
ident   ... more description
delta   1 minute
probe   sample.secret.foo.one values ? include : exclude
        sample.secret.foo.one
        sample.secret.foo.bar   # non-leaf in the PMNS
        sample.colour [ red green ]

Migration

The current version of pmlogconf (2.0) supports a slightly different format for configfile compared to earlier versions.  If an old version configfile is presented to pmlogconf it will be converted to the new format.

PCP Environment

Environment variables with the prefix PCP_ are used to parameterize the file and directory names used by PCP. On each installation, the file /etc/pcp.conf contains the local values for these variables. The $PCP_CONF variable may be used to specify an alternative configuration file, as described in pcp.conf(5).

pmlogconf overrides any $PCP_DERIVED_CONFIG environment variable to an empty string, for performance reasons.

pmlogconf honours the $PMCD_WAIT_TIMEOUT environment variable when probing and creating new pmlogger configuration files. It uses a default timeout value of 10 seconds for this, in the absence of an environment setting.

See Also

pmcd(1), pmlogger(1), pcp.conf(5) and pcp.env(5).

Referenced By

pcp(1), pmlogger_check(1), pmmgr(1).

PCP Performance Co-Pilot