Defined Type: mariadb::monitor_backup

Defined in:
modules/mariadb/manifests/monitor_backup.pp

Overview

Checks the metadata database backups of a particular section, datacenter and type, and sets up an icinga alert about it

Parameters:

  • section (Any)
  • datacenter (Any)
  • type (Any) (defaults to: 'dump')
  • freshness (Any) (defaults to: 691200)
  • min_size (Any) (defaults to: 1000000)
  • warn_size_percentage (Any) (defaults to: 3)
  • crit_size_percentage (Any) (defaults to: 15)


3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'modules/mariadb/manifests/monitor_backup.pp', line 3

define mariadb::monitor_backup (
    $section,
    $datacenter,
    $type                 = 'dump',
    $freshness            = 691200,  # 8 days
    $min_size             = 1000000,
    $warn_size_percentage = 3,
    $crit_size_percentage = 15,
) {

    $check_command = "/usr/local/bin/check_mariadb_backups.py --section='${section}' --datacenter='${datacenter}' \
--type='${type}' --freshness='${freshness}' --min-size='${min_size}' \
--warn-size-percentage='${warn_size_percentage}' --crit-size-percentage='${crit_size_percentage}'"

    nrpe::monitor_service { "mariadb_${type}_${section}_${datacenter}":
        description    => "${type} of ${section} in ${datacenter}",
        nrpe_command   => $check_command,
        critical       => false,
        contact_group  => 'admins',
        check_interval => 30,  # Don't check too often
        require        => File['/usr/local/bin/check_mariadb_backups.py'],
        notes_url      => 'https://wikitech.wikimedia.org/wiki/MariaDB/Backups#Alerting',
    }
}