A pgBackRest backup check plugin for Nagios

A pgBackRest backup check plugin for Nagios

check_pgbackrest is designed to monitor pgBackRest backups from Nagios.

Features

Installation

  1. Install the Official PostgreSQL yum repo package or the Dalibo Labs yum repo package

  2. yum install nagios-plugins-pgbackrest

Remark: epel-release also needs to be installed first.

Usage

List available services

$ check_pgbackrest --list

List of available services:
  archives          Check WAL archives.
  check_pgb_version Check the version of this check_pgbackrest script.
  retention         Check the retention policy.

 

Check the retention policy

$ check_pgbackrest --stanza=my_stanza 
  --service=retention --retention-full=1 --output=human
  --retention-age=24h --retention-age-to-full=7d

Service        : BACKUPS_RETENTION
Returns        : 0 (OK)
Message        : backups policy checks ok
Long message   : full=1
Long message   : diff=1
Long message   : incr=1
Long message   : latest=incr,20200131-150158F_20200131-150410I
Long message   : latest_age=2m47s
Long message   : latest_full=20200131-150158F
Long message   : latest_full_age=5m

Fails when:

 

Check WAL archives

1/ Local storage

$ check_pgbackrest --stanza=my_stanza
  --service=archives --repo-path=/var/lib/pgbackrest/archive --output=human
Service        : WAL_ARCHIVES
Returns        : 0 (OK)
Message        : 81 WAL archived
Message        : latest archived since 1m59s
Long message   : latest_archive_age=1m59s
Long message   : num_archives=81
Long message   : archives_dir=/var/lib/pgbackrest/archive/my_stanza/12-1
Long message   : min_wal=000000010000000000000003
Long message   : max_wal=000000010000000000000053
Long message   : oldest_archive=000000010000000000000003
Long message   : latest_archive=000000010000000000000053
Long message   : latest_bck_archive_start=000000010000000000000007
Long message   : latest_bck_type=incr

2/ Remote storage

3/ S3 storage

4/ Go further

Licence

check_pgbackrest is licensed under PostgreSQL license.

Contributors

check_pgbackrest is maintained by the following Dalibo Labs team members, with the contribution of many from the open source community: