| PMSEARCH_DAILY(1) | General Commands Manual | PMSEARCH_DAILY(1) |
NAME
pmsearch_daily - rebuild the PCP full-text search index
SYNOPSIS
pmsearch_daily [-NV?] [-a archive] [-o index]
DESCRIPTION
pmsearch_daily rebuilds the runtime full-text search index used by pmsearch(1) and the pmproxy(1) /search REST API endpoint.
Its primary purpose is to capture instance names (disk devices, network interfaces, filesystems, etc.) that are only known on a running system. It queries the running pmcd(1) (or a PCP archive when -a is specified) for all metric names, help text, and instance domain members, then builds a SQLite FTS5 search index using newhelp(1). The resulting index file is written to $PCP_VAR_DIR/lib/pmsearch.index by default.
Each night, the script copies the base index shipped with the PCP package and extends the copy with instance data from the running system. This ensures the nightly index always starts fresh from the complete set of metric help text.
This command is typically invoked nightly via a systemd timer or cron job.
If pmcd is not running or no metrics are found, the command exits without modifying any existing index file. The base index at $PCP_SHARE_DIR/lib/pmsearch.index remains available as a fallback.
OPTIONS
- -a archive, --archive=archive
- Use archive as the source of metric metadata and instance data instead of querying the running pmcd(1). This is useful for testing or for building an index on a system where pmcd is not running.
- -N, --showme
- Dry-run mode. Show what would be done without writing any files.
- -o index, --output=index
- Write the index to index instead of the default $PCP_VAR_DIR/lib/pmsearch.index.
- -V, --verbose
- Verbose diagnostics. Report the number of metrics extracted and the output path.
- -?, --help
- Display usage message and exit.
FILES
- $PCP_VAR_DIR/lib/pmsearch.index
- Default output path for the runtime search index. This is a copy of the base index extended with instance data. When present, it is preferred over the base index.
- $PCP_SHARE_DIR/lib/pmsearch.index
- Base search index shipped with the PCP package, built at package build time from help text source files. Copied as the starting point for each nightly rebuild; used directly as a fallback when the runtime index does not exist.
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).
SEE ALSO
PCPIntro(1), newhelp(1), pmcd(1), pminfo(1), pmsearch(1) and pmproxy(1).
| PCP | Performance Co-Pilot |