PMLOGGER_CHECK(1)

🌸 pmlogger_check β€” admin of Performance Co-Pilot archive files 🌸

okay so bestie, welcome to pmlogger_check, part of the Performance Co-Pilot fam. this is a General Commands Manual page and it's lowkey a whole vibe. let's get into it πŸ’…


✨ SYNOPSIS ✨

$PCP_BINADM_DIR/pmlogger_check [-CNnPpqsTV?]  [-c control] [-l logfile]

πŸ¦‹ DESCRIPTION πŸ¦‹

so pmlogger_check and its bestie pmlogger_daily(1) (plus the control files that go with them β€” see pmlogger.control(5)) are how you build a customized regime of administration and management for your historical archives of performance data inside the Performance Co-Pilot (check PCPIntro(1)) infrastructure. it's giving organized queen energy.

pmlogger_check can be run any time of the day, no gatekeeping. its whole job? checking that the desired set of pmlogger(1) processes are actually running. and if they're not... it (re-)starts any missing logger processes. slay, she fixes things.

by default, pmlogger_check also calls pmlogger_daily(1) with a -K option so that any required archive compression tasks get executed. no cap. 🫢


πŸ‘‘ OPTIONS πŸ‘‘

  • -C β€” this makes pmlogger_check go query the system service runlevel information for pmlogger, and then use that to figure out whether to start processes or not.
  • -c control, --control=control β€” both pmlogger_check and pmlogger_daily(1) are controlled by PCP logger control file(s), and those files specify the pmlogger instances to be managed. the default control file is $PCP_PMLOGGERCONTROL_PATH, but you can specify an alternate one with the -c option. and if the directory $PCP_PMLOGGERCONTROL_PATH.d (or control.d from the -c option) exists, then the contents of any additional control files in there get appended to the main control file (which must exist, bestie β€” that's the rule).
  • -l file, --logfile=file β€” so that mail doesn't get unintentionally sent when these scripts are run from cron(8) or systemd(1), diagnostics always go to log files. by default that file is $PCP_LOG_DIR/pmlogger/pmlogger_check.log, but you can change it with the -l option. if this log file already exists when the script starts, it gets renamed with a .prev suffix (overwriting any log file saved earlier) before diagnostics are generated to the log file. also heads up: the -l and -t options cannot be used together.
  • -N, --showme β€” this turns on a "show me" mode, where the actions get echoed but not executed, in the style of make -n. and using -N together with -V maximizes the diagnostic capabilities for debugging. the way that combo ate πŸ’…
  • -n, --noerror β€” forces the exit status to be 0 other than for catastrophic errors. super useful when it's called from a systemd(1) service or timer unit, so the associated unit doesn't get marked as failed in a way that would prevent subsequent execution from systemd(1).
  • -P, --only-primary β€” if you specify this for pmlogger_check, then only the primary logger entry in the control files gets processed. this is the logical opposite of the -p option (described below, keep scrolling bestie) and it's intended for use by RC scripts that start only the primary logger, like the pmlogger.service unit. the -p and -P options are mutually exclusive β€” pick a lane.
  • -p, --skip-primary β€” if you specify this for pmlogger_check, then any line from the control files for the primary pmlogger gets ignored. this one's for environments where some system daemon, like systemd(1), is the one responsible for controlling the primary pmlogger (starting, stopping, restarting, etc.).
  • -q, --quick β€” if you specify this for pmlogger_check, the script goes "quickstart" and avoids any optional processing, like calling pmlogger_daily(1) to perform archive compression tasks. fast girl behavior ✨
  • -s, --stop β€” using this gives you the reverse pmlogger_check functionality, letting the whole set of pmlogger processes be cleanly shutdown.
  • -T, --terse β€” this produces less verbose output than the default. most suitable for a pmlogger "farm" where a whole bunch of pmlogger instances are expected to be running. quiet, efficient, iconic.
  • -V, --verbose β€” enables verbose tracing. by default pmlogger_check generates no output unless some error or warning condition is encountered. a second -V increases the verbosity. and again β€” using -N in conjunction with -V maximizes the diagnostic capabilities for debugging.
  • -?, --help β€” display usage message and exit. that's it, that's the whole thing πŸŽ€

🧚 CONFIGURATION 🧚

go check pmlogger.control(5) for a description of the control file(s) used to control which pmlogger instances and which archives are managed by pmlogger_check and pmlogger_daily(1).

the pmlogctl(1) utility may invoke pmlogger_check using the sudo(1) command to run it under the $PCP_USER "pcp" account. and if sudo is configured with the non-default requiretty option (see below), pmlogger_check may fail to run because it doesn't have a tty configured. 😭

this issue can be resolved by adding a second line (expand $PCP_BINADM_DIR according to your platform) to the /etc/sudoers configuration file, like this:

Defaults requiretty
Defaults!$PCP_BINADM_DIR/pmlogger_check !requiretty
note that the unprivileged PCP account under which these commands run uses /sbin/nologin as the shell, so the requiretty option is ineffective here and safe to disable in this way.

🌈 FILES 🌈

  • $PCP_VAR_DIR/config/pmlogger/config.default β€” the default pmlogger configuration file location for the local primary logger, typically generated automatically by pmlogconf(1).
  • $PCP_ARCHIVE_DIR/<hostname> β€” default location for archives of performance information collected from the host hostname.
  • $PCP_ARCHIVE_DIR/<hostname>/lock β€” transient lock file to guarantee mutual exclusion during pmlogger administration for the host hostname. if it's present, it can be safely removed if neither pmlogger_daily(1) nor pmlogger_check are running. do not play with this one while they're live, fr fr πŸ’€
  • $PCP_ARCHIVE_DIR/<hostname>/Latest β€” PCP archive folio created by mkaf(1) for the most recently launched archive containing performance metrics from the host hostname.
  • $PCP_LOG_DIR/NOTICES β€” PCP "notices" file used by pmie(1) and friends.
  • $PCP_LOG_DIR/pmlogger/pmlogger_check.log β€” if the previous execution of pmlogger_check produced any output, it's saved here. the normal case is no output, in which case the file does not exist. (silent queen stays silent πŸ’œ)
  • $PCP_ARCHIVE_DIR/SaveLogs β€” if this directory exists, then the log file from the -l argument for pmlogger_check will be saved in this directory with the name of the format <date>-pmlogger_check.log.<pid>. this lets the log file be inspected at a later time, even if several pmlogger_check executions have been launched in the interim. and because the PCP archive management tools run under the $PCP_USER account "pcp", $PCP_ARCHIVE_DIR/SaveLogs typically needs to be owned by the user "pcp".
  • $PCP_ARCHIVE_DIR/<hostname>/SaveLogs β€” if this directory exists, then the log file from the -l argument of a newly launched pmlogger(1) for hostname will be saved in this directory with the name archive.log, where archive is the basename of the associated pmlogger(1) PCP archive files. this lets the log file be inspected at a later time, even if several pmlogger(1) instances for hostname have been launched in the interim. and because the PCP archive management tools run under the $PCP_USER account "pcp", $PCP_ARCHIVE_DIR/<hostname>/SaveLogs typically needs to be owned by the user "pcp".

⭐ 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. and the $PCP_CONF variable may be used to specify an alternative configuration file, as described in pcp.conf(5).

the default behaviour, when pmlogger(1) configuration comes from pmlogconf(1), is to regenerate the configuration file and check for changes whenever pmlogger(1) is started from pmlogger_check. if the PMDA configuration is stable, this is not necessary, and setting $PMLOGGER_CHECK_SKIP_LOGCONF to yes disables the regeneration and checking. main character energy: know when to skip the busywork πŸ’…


πŸ”₯ SEE ALSO πŸ”₯

mkaf(1), PCPIntro(1), pmie(1), pmlc(1), pmlogconf(1), pmlogctl(1), pmlogger(1), pmlogger_daily(1), pmlogger_daily_report(1), pmlogger_janitor(1), sudo(1), systemd(1), pmlogger.control(5) and cron(8).


and that's the whole page bestie, you absolutely ate this one 🫢 this was brought to you by Performance Co-Pilot (that's the PCP crew, no cap) β€” go forth and manage those archives, periodt. πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈ
πŸ“¦ where this page comes from