CHECK_PGBACKREST(1)

πŸ“¦
version 2.4 Β· 4 versions
, in ubuntu resolute, ubuntu stonking

πŸ’… NAME πŸ’…

check_pgbackrest β€” the pgBackRest backup check plugin for Nagios, bestie. Yes, it's really out here monitoring your backups so you don't have to lie awake at 3am wondering. 🫢


✨ SYNOPSIS ✨

  check_pgbackrest [-s|--service SERVICE] [-S|--stanza NAME]
  check_pgbackrest [-l|--list]
  check_pgbackrest [--help]

🌸 DESCRIPTION 🌸

okay so check_pgbackrest is literally built to monitor pgBackRest (2.52 and above) backups from Nagios. like, that's the whole job. it's giving "responsible adult who actually checks their backups". πŸ’–

  • -s, --service SERVICE β€” the Nagios service to run. peek at the SERVICES section below for what each one does, or just use --list for a short little service + description list. super convenient, no cap.
  • -S, --stanza NAME β€” name of the stanza to check. that's the stanza, bestie, not your fave playlist.
  • --repo REPOSITORY β€” the repository index to operate on. if you don't pass a --repo argument, the service will operate on all repositories defined, checking for inconsistencies across multiple repositories. and when you're using multiple repositories, it's recommended to also define checks using the --repo argument to verify the sanity of each repository separately. one repo at a time = vibe check per repo, iykyk.
  • -O, --output OUTPUT_FORMAT β€” the output format, bestie. supported outputs are: human, json, nagios (default), nagios_strict and prtg.

the nagios_strict output format will filter out unsupported types of values from the performance data. it's the "no extras, just the facts" of output formats. πŸ’…

  • -C, --command FILE β€” pgBackRest executable file (default: pgbackrest). literally which binary to poke.
  • -c, --config CONFIGURATION_FILE β€” pgBackRest configuration file. yes, the whole config, slay.
  • -P, --prefix COMMAND β€” some prefix command to execute the pgBackRest info command (eg: sudo -iu postgres). the little "excuse me, run this as someone else" garnish. πŸŽ€
  • -l, --list β€” list available services. short king of a flag, tells you everything available.
  • --debug β€” print some debug messages. chaos mode: on, but useful.
  • -V, --version β€” print version and exit. bye bestie πŸ‘‹
  • -?, --help β€” show this help page.

πŸ¦‹ SERVICES πŸ¦‹

descriptions and parameters of available services. buckle up, this is the main character section.

retention

  • Fail when the number of full backups is less than the --retention-full argument. 🌸
  • Fail when the number of differential backups is less than the --retention-diff argument.
  • Fail when the number of incremental backups is less than the --retention-incr argument.
  • Fail when the newest backup is older than the --retention-age argument.
  • Fail when the newest full backup is older than the --retention-age-to-full argument.
  • Fail when the oldest backup is newer than the --retention-age-to-oldest argument.

The following units are accepted (not case sensitive): s (second), m (minute), h (hour), d (day). You can use more than one unit per given value. so like, mix and match, it's very chill.

Arguments are not mandatory to only show some information. so if you just wanna see stuff and not get yelled at, that's allowed. πŸ’œ

archives

Check if all archived WALs exist between the oldest and the latest WAL needed for the recovery. the "did we lose any WAL" detective service. πŸ”

Use the --wal-segsize argument to set the WAL segment size.

The following units are accepted (not case sensitive): b (Byte), k (KB), m (MB), g (GB), t (TB), p (PB), e (EB) or Z (ZB). Only integers are accepted. Eg. 1.5MB will be refused, use 1500kB. no decimals, she does not do decimals. πŸ’€

The factor between units is 1024 bytes. Eg. 1g = 1G = 1024*1024*1024.

Use the --ignore-archived-before argument to ignore the archived WALs generated before the provided interval. Used to only check the latest archives. it's giving "we don't care about the old stuff rn".

Use the --ignore-archived-after argument to ignore the archived WALs generated after the provided interval.

The --latest-archive-age-alert argument defines the max age of the latest archived WAL as an interval before raising a critical alert. ⚠️

The following units are accepted as interval (not case sensitive): s (second), m (minute), h (hour), d (day). You can use more than one unit per given value. If not set, the last unit is in seconds. Eg. 1h 55m 6 = 1h55m6s. so cute that it just assumes seconds at the end.

All the missing archives are only shown in the --debug mode. so if you want the tea, you need --debug.

Use --list-archives in addition with --debug to print the list of all the archived WAL segments.

Use --list-boundaries in addition with --debug to print the list of all the boundary WAL segments fetched from the history files. yes, plural flags, plural fun. ✨

By default, all the archives older than the oldest backup start archive or newer than max_wal returned by the pgBackRest info command are ignored. default behaviour my beloved.

Use the --extended-check argument to force a full check of the found archives and raise warnings in case of inconsistencies. πŸ”₯

When WAL archives on different timelines are found, .history files are parsed to find the switch point and define the boundary WAL. timeline girlies rise.

Use the --max-archives-check-number to prevent infinite WAL archives check when boundary WAL can't be defined properly. > this one is genuinely important bestie β€” without it you can get stuck in an endless check loop, and nobody has time for that. 🫢

In case of pgBackRest db history change (after a successful stanza-upgrade), only the latest db system/version will be checked.

check_pgb_version

Check if this script is running a given version.

You must provide the expected version using --target-version. mandatory, no skipping. πŸ’…

pgbackrest_version

Check if pgBackRest is running a given version.

You must provide the expected version using --target-version. same energy, different target.


🌈 CONTRIBUTING 🌈

check_pgbackrest is an open project. Any contribution to improve it is welcome. come thru, we love a collaborator. πŸŽ€


⭐ VERSION ⭐

check_pgbackrest version 2.4, released on Fri Jul 05 2024. iconic behaviour, honestly.


πŸ‘‘ LICENSING πŸ‘‘

This program is open source, licensed under the PostgreSQL license. For license terms, see the LICENSE file. free and legal, we love to see it.


πŸ’– AUTHORS πŸ’–

  • Author: Stefan Fercot. 🫢
  • Logo: Damien Cazeils (www.damiencazeils.com).
  • Copyright: (c) 2018-2020, Dalibo / 2020-2024, Stefan Fercot.

and that's the whole page bestie β€” this was check_pgbackrest version 2.4 from the 2026-01-14 era of the CHECK_PGBACKREST(1) manual. now go check your backups, you gorgeous responsible sysadmin. periodt. πŸ’…πŸ¦‹βœ¨

πŸ“¦ where this page comes from