Puppet Class: openstack::monitor::spreadcheck

Defined in:
modules/openstack/manifests/monitor/spreadcheck.pp

Overview

Class: openstack::monitor::spreadcheck

NRPE check to see if critical instances for a project are spread out enough among the labvirt* hosts

Parameters:

  • active (Any)


4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'modules/openstack/manifests/monitor/spreadcheck.pp', line 4

class openstack::monitor::spreadcheck(
    $active,
) {
    # monitoring::service doesn't take a bool
    if $active {
        $ensure = 'present'
    }
    else {
        $ensure = 'absent'
    }

    # Script that checks how 'spread out' critical instances for a project
    # are. See T101635
    file { '/usr/local/sbin/wmcs-spreadcheck':
        ensure => $ensure,
        owner  => 'root',
        group  => 'root',
        mode   => '0755',
        source => 'puppet:///modules/openstack/monitor/wmcs-spreadcheck.py',
    }

    # Config file to check how spread out toolforge critical instances are
    file { '/etc/wmcs-spreadcheck-tools.yaml':
        ensure => $ensure,
        owner  => 'nagios',
        group  => 'nagios',
        mode   => '0400',
        source => 'puppet:///modules/openstack/monitor/wmcs-spreadcheck-tools.yaml',
    }

    nrpe::monitor_service { 'check-tools-spread':
        ensure       => $ensure,
        nrpe_command => '/usr/local/sbin/wmcs-spreadcheck --config /etc/wmcs-spreadcheck-tools.yaml',
        description  => 'Toolforge instance distribution',
        require      => File[
            '/usr/local/sbin/wmcs-spreadcheck',
            '/etc/wmcs-spreadcheck-tools.yaml'
        ],
        notes_url    => 'https://wikitech.wikimedia.org/wiki/Portal:Cloud_VPS/Admin/Troubleshooting',
    }

    # renaming cleanup
    $files = [
        '/usr/local/bin/spreadcheck.py',
        '/usr/local/etc/spreadcheck-tools.yaml',
    ]

    file { $files:
        ensure => 'absent',
    }
}