pmlogger_daily , pmlogger_check , and pmlogger_merge are equivalent to the scripts cron.pmdaily, cron.pmcheck and cron.pmlogmerge which are deprecated but preserved on IRIX for backward compatibility.
pmlogger_daily is intended to be run once per day, preferably in the early morning, as soon after midnight as practicable. Its task is to aggregate and rotate one or more sets of PCP archives. After some period, old PCP archives are discarded. This period is 14 days by default, but may be changed using the -k option. Two special values are recognized for the period (discard), namely 0 to keep no archives beyond the current one, and forever to prevent any archives being discarded.
Archive data files can optionally be compressed after some period (compress), to conserve disk space. This is particularly useful for large numbers of pmlogger processes under the control of pmlogger_check. The -x option specifies the number of days after which to compress archive data files, and the -X option specifies the program to use for compression - by default this is bzip2(1). Use of the -Y 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 ".meta$|.index$|.Z$|.gz$|.bz2|.zip$" - such files are filtered using the -v option to egrep(1).
In addition, 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.
Use of the -m 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.
pmlogger_check may be run at any time, and is intended to check that the desired set of pmlogger(1) processes are running, and if not to re-launch any failed loggers.
pmlogger_merge is a wrapper script for pmlogmerge(1) that merges all of the archive logs matching the input-basename arguments, and creates a new archive using output-name as the base name for the physical files that constitute an archive log. The input-basename arguments may contain meta characters in the style of sh(1). If specified, the -f option causes all of the input files to be removed once the output archive has been created.
pmlogger_merge is used by pmlogger_daily.
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 want argument will ensure that trace files created with -t will be kept for want days and then discarded.
Both pmlogger_daily and pmlogger_check are controlled by a PCP logger control file 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.
The control file should be customized according to the following rules that define for the current version (1.1) of the control file format.
$ PMCD_CONNECT_TIMEOUT=20
$ version=1.1
host y|n y|n directory args
The following sample control lines specify a primary logger on the local host (bozo), and a non-primary logger to collect and log performance metrics from the host boing.
$version=1.1 bozo y n $PCP_LOG_DIR/pmlogger/bozo -c config.default boing n n $PCP_LOG_DIR/pmlogger/boing -c ./pmlogger.config
Typical crontab(5) entries for periodic execution of pmlogger_daily and pmlogger_check are given in $PCP_VAR_DIR/config/pmlogger/crontab and shown below. Due to the file permissions involved, these should be added to the crontab for root if automated PCP archive log maintenance is desired.
# daily processing of archive logs 14 0 * * * $PCP_BINADM_DIR/pmlogger_daily # every 30 minutes, check pmlogger instances are running 28,58 * * * * $PCP_BINADM_DIR/pmlogger_check
Alternate redirection of the output from the cron(1) execution of the scripts may be controlled as follows:
su_pcp:x:0:0:PCP Housekeeping:/usr/people/su_pcp:/dev/null
The -N option enables a ``show me'' mode, where the actions are echoed, but not executed, in the style of ``make -n''. Using -N in conjunction with -V maximizes the diagnostic capabilities for debugging.
By default all possible archives will be merged. The -o option reinstates the old behaviour in which only yesterday's archives will be considered as merge candidates.
The -T option provides a terser form of output for pmlogger_check that is most suitable for a pmlogger ``farm'' where many instances of pmlogger are expected to be running.
The script $PCP_BINADM_DIR/pmlogger_daily could be copied and modified to implement a site-specific procedure for end-of-week and/or end-of-month management for a set of PCP archives.