Check Rear backup

Script: check_rearbackup

This check can verify the age of all iso files in the backup target directory.

Requirements

There can be a permission issue to reach the backup target directory. On our servers the backup target is using a user imlbackup. To give access to its resources we added the group “imlrear” for icinga.

$ id icingaclient
uid=1041(icingaclient) gid=1041(icingaclient) groups=1041(icingaclient),1056(imlrear)
                                                                             ^
                                                                             |
                                additional group for icinga client user -----+

Standalone installation

From this repository ypu need next to this script:

  • inc_pluginfunctions shared function for all IML checks written in bash

Syntax

______________________________________________________________________

CHECK_REARBACKUP
v1.0

(c) Institute for Medical Education - University of Bern
Licence: GNU GPL 3

https://os-docs.iml.unibe.ch/icinga-checks/Checks/check_rearbackup.html
______________________________________________________________________

Check if iso files of rear backup are not out of date.
You can customize the values for
* backup directory
* limits for warning and critical

This plugin sends performancedata.

SYNTAX:

  check_rearbackup [-h] [--dir PATH] [--critical VALUE] [--warning VALUE]

OPTIONS:

  -h, --help 
      this help

PARAMETERS:

  -d, --dir PATH
      set installation dir of iml deployment to find its check skript
      default dir: /rearshare/rear-backup

  -c, --critical VALUE
      critical level in days (default: 14)

  -w. --warning VALUE
      warning level in days (default: 7)

EXAMPLE:

  check_rearbackup
      Check backup data with initial values

  check_rearbackup -d /data/mybackups
      Check iso files a given directory
    
  check_rearbackup -d /data/mybackups -w 14 -c 28
      Check iso files a given directory and customized limits

Examples

Rear backup status

# ./check_rearbackup
CRITICAL: Rear backup /rearshare/rear-backup - 20 total - 0 critical (7 d) .. 2 warnings (14 d) .. 18 OK

All iso files in alphabetic order:
OK          4 d ####        -rw-rw-r--. 1 imlrear imlrear 3907082240 Dec 17 10:28 /rearshare/rear-backup/admin/admin.example.com_backup.iso
OK          5 d #####       -rw-rw-r--. 1 imlrear imlrear 573384704 Dec 16 18:07 /rearshare/rear-backup/awx/awx.example.com_backup.iso
(...)

|ok=18;;;0;20 warning=2;;;0;20 critical=0;;;0;20