Путеводитель по Руководству Linux

  User  |  Syst  |  Libr  |  Device  |  Files  |  Other  |  Admin  |  Head  |



   pmlogger_check    ( 1 )

администрирование файлов журналов архива Performance Co-Pilot (administration of Performance Co-Pilot archive log files)

Параметры (Options)

-c control, --control=control
            Both pmlogger_check and pmlogger_daily are controlled by PCP
            logger control file(s) that specifies the pmlogger instances
            to be managed.  The default control file is
            $PCP_PMLOGGERCONTROL_PATH, but an alternate may be specified
            using the -c option.  If the directory
            $PCP_PMLOGGERCONTROL_PATH.d (or control.d from the -c
            option) exists, then the contents of any additional control
            files therein will be appended to the main control file
            (which must exist).

-C This option causes pmlogger_check to query the system service runlevel information for pmlogger, and use that to determine whether to start processes or not.

-E, --expunge This option causes pmlogger_daily to pass the -E flag to pmlogger_merge in order to expunge metrics with metadata inconsistencies and continue rather than fail. This is intended for automated daily log rotation where it is highly desirable for unattended daily archive merging, rewriting and compression to succeed. For further details, see pmlogger_merge(1) and description for the -x flag in pmlogextract(1).

-f, --force This option causes pmlogger_daily to forces action. Using this option in production is not recommended.

-k time, --discard=time After some period, old PCP archives are discarded. time is a time specification in the syntax of find-filter(1), so DD[:HH[:MM]]. The optional HH (hours) and MM (minutes) parts are 0 if not specified. By default the time is 14:0:0 or 14 days, but may be changed using this option.

Some special values are recognized for the time, namely 0 to keep no archives beyond the the ones being currently written by pmlogger(1), and forever or never to prevent any archives being discarded.

The time can also be set using the $PCP_CULLAFTER variable, set in either the environment or in a control file. If both $PCP_CULLAFTER and -k specify different values for time then the environment variable value is used and a warning is issued. I.e., if $PCP_CULLAFTER is set in the control file, it overrides -k given on the command line.

Note that the semantics of time are that it is measured from the time of last modification of each archive, and not from the original archive creation date. This has subtle implications for compression (see below) - the compression process results in the creation of new archive files which have new modification times. In this case, the time period (re)starts from the time of compression.

-K When this option is specified for pmlogger_daily then only the compression tasks are attempted, so no pmlogger rotation, no culling, no rewriting, etc. When -K is used and a period of 0 is in effect (from -x on the command line or $PCP_COMPRESSAFTER in the environment or via the control file) this is intended for environments where compression of archives is desired before the scheduled daily processing happens. To achieve this, once pmlogger_check has completed regular processing, it calls pmlogger_daily with just the -K option. Provided $PCP_COMPRESSAFTER is set to 0 along with any other required compression options to match the scheduled invocation of pmlogger_daily, then this will compress all volumes except the ones being currently written by pmlogger(1). If $PCP_COMPRESSAFTER is set to a value greater than zero, then manually running pmlogger_daily with the -x option may be used to compress volumes that are younger than the $PCP_COMPRESSAFTER time. This may be used to reclaim filesystem space by compressing volumes earlier than they would have otherwise been compressed. Note that since the default value of $PCP_COMPRESSAFTER is 0 days, the -x option has no effect unless the control file has been edited and $PCP_COMPRESSAFTER has been set to a value greater than 0.

-l file, --logfile=file In order to ensure that mail is not unintentionally sent when these scripts are run from cron(8) diagnostics are always sent to log files. By default, this file is $PCP_LOG_DIR/pmlogger/pmlogger_check.log or $PCP_LOG_DIR/pmlogger/pmlogger_daily.log but this can be changed using the -l option. If this log file already exists when the script starts, it will be renamed with a .prev suffix (overwriting any log file saved earlier) before diagnostics are generated to the log file. The -l and -t options cannot be used together.

-m addresses, --mail=addresses Use of this option causes pmlogger_daily to construct a summary of the ``notices'' file entries which were generated in the last 24 hours, and e-mail that summary to the set of space-separated addresses. This daily summary is stored in the file $PCP_LOG_DIR/NOTICES.daily, which will be empty when no new ``notices'' entries were made in the previous 24 hour period.

-M This option may be used to disable archive merging (or renaming) and rewriting (-M implies -r). This is most useful in cases where the archives are being incrementally copied to a remote repository, e.g. using rsync(1). Merging, renaming and rewriting all risk an increase in the synchronization load, especially immediately after pmlogger_daily has run, so -M may be useful in these cases.

-N, --showme This option enables a ``show me'' mode, where the programs actions are echoed, but not executed, in the style of ``make -n''. Using -N in conjunction with -V maximizes the diagnostic capabilities for debugging.

-o By default all possible archives will be merged. This option reinstates the old behaviour in which only yesterday's archives will be considered as merge candidates. In the special case where only a single input archive needs to be merged, pmlogmv(1) is used to rename the archive, otherwise pmlogger_merge(1) is used to merge all of the archives for a single host and a single day into a new PCP archive and the individual archives are removed.

-p, --skip-primary If this option is specified for pmlogger_check then any line from the control files for the primary pmlogger will be ignored. This option is intended for environments where some system daemon, like systemd(1), is responsible for controlling (starting, stopping, restarting, etc.) the primary pmlogger.

-p If this option is specified for pmlogger_daily then the status of the daily processing is polled and if the daily pmlogger(1) rotation, culling, rewriting, compressing, etc. has not been done in the last 24 hours then it is done now. The intent is to have pmlogger_daily called regularly with the -p option (at 30 mins past the hour, every hour in the default cron(8) set up) to ensure daily processing happens as soon as possible if it was missed at the regularly scheduled time (which is 00:10 by default), e.g. if the system was down or suspended at that time. With this option pmlogger_daily simply exits if the previous day's processing has already been done. The -K and -p options to pmlogger_daily are mutually exclusive.

-q, --quick If this option is specified for pmlogger_check then the script will ``quickstart'' avoiding any optional processing like file compression.

-r, --norewrite This command line option acts as an override and prevents all archive rewriting with pmlogrewrite(1) independent of the presence of any rewriting rule files or directories.

-R, --rewriteall Sometimes PMDA changes require all archives to be rewritten, not just the ones involved in any current merging. This is required for example after a PCP upgrade where a new version of an existing PMDA has revised metadata. The -R command line forces this universal-style of rewriting. The -R option to pmlogger_daily is mutually exclusive with both the -r and -M options.

-s size, --rotate=size If the PCP ``notices'' file ($PCP_LOG_DIR/NOTICES) is larger than 20480 bytes, pmlogger_daily will rename the file with a ``.old'' suffix, and start a new ``notices'' file. The rotate threshold may be changed from 20480 to size bytes using the -s option.

-s, --stop Use of this option provides the reverse pmlogger_check functionality, allowing the set of pmlogger processes to be cleanly shutdown.

-t period To assist with debugging or diagnosing intermittent failures the -t option may be used. This will turn on very verbose tracing (-VV) and capture the trace output in a file named $PCP_LOG_DIR/pmlogger/daily.datestamp.trace, where datestamp is the time pmlogger_daily was run in the format YYYYMMDD.HH.MM. In addition, the period argument will ensure that trace files created with -t will be kept for period days and then discarded.

-T, --terse This option to pmlogger_check produces less verbose output than the default. This is most suitable for a pmlogger ``farm'' where many instances of pmlogger are expected to be running.

-V, --verbose The output from the cron execution of the scripts may be extended using the -V option to the scripts which will enable verbose tracing of their activity. By default the scripts generate no output unless some error or warning condition is encountered. Using -N in conjunction with -V maximizes the diagnostic capabilities for debugging.

-x time, --compress-after=time Archive data files can optionally be compressed after some period to conserve disk space. This is particularly useful for large numbers of pmlogger processes under the control of pmlogger_check.

time is a time specification in the syntax of find-filter(1), so DD[:HH[:MM]]. The optional HH (hours) and MM (minutes) parts are 0 if not specified.

Some special values are recognized for the time, namely 0 to apply compression as soon as possible, and forever or never to prevent any compression being done.

If transparent_decompress is enabled when libpcp was built (can be checked with the pmconfig(1) -L option), then the default behaviour is compression ``as soon as possible''. Otherwise the default behaviour is to not compress files (which matches the historical default behaviour in earlier PCP releases).

The time can also be set using the $PCP_COMPRESSAFTER variable, set in either the environment or in a control file. If both $PCP_COMPRESSAFTER and -x specify different values for time then the environment variable value is used and a warning is issued. For important other detailed notes concerning volume compression, see the -K and -k options (above).

-X program, --compressor=program This option specifies the program to use for compression - by default this is xz(1). The environment variable $PCP_COMPRESS may be used as an alternative mechanism to define program. If both $PCP_COMPRESS and -X specify different compression programs then the environment variable value is used and a warning is issued.

-Y regex, --regex=regex This option allows a regular expression to be specified causing files in the set of files matched for compression to be omitted - this allows only the data file to be compressed, and also prevents the program from attempting to compress it more than once. The default regex is ".(index|Z|gz|bz2|zip|xz|lzma|lzo|lz4)$" - such files are filtered using the -v option to egrep(1). The environment variable $PCP_COMPRESSREGEX may be used as an alternative mechanism to define regex. If both $PCP_COMPRESSREGEX and -Y specify different values for regex then the environment variable value is used and a warning is issued.

-?, --help Display usage message and exit.