Defined Type: mariadb::monitor_readonly

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

Overview

Check that the given instance is in the given read-only mode Alert if we find the oppsite value use it by adding the appropiate section name ('s1', 'm3', etc.)

Parameters:

  • read_only (Any) (defaults to: 1)
  • port (Any) (defaults to: 3306)
  • is_critical (Any) (defaults to: false)
  • contact_group (Any) (defaults to: 'admins')


4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'modules/mariadb/manifests/monitor_readonly.pp', line 4

define mariadb::monitor_readonly(
    $read_only     = 1,
    $port          = 3306,
    $is_critical   = false,
    $contact_group = 'admins',
) {

    $check_command = "db-check-health --port=${port} --icinga --check_read_only=${read_only} --process"

    nrpe::monitor_service { "mariadb_read_only_${name}":
        description   => "MariaDB read only ${name}",
        nrpe_command  => $check_command,
        critical      => $is_critical,
        contact_group => $contact_group,
        require       => Package['wmfmariadbpy-common'],
        notes_url     => 'https://wikitech.wikimedia.org/wiki/MariaDB/troubleshooting#Master_comes_back_in_read_only',
    }
}