Puppet Class: labstore::monitoring::primary

Defined in:
modules/labstore/manifests/monitoring/primary.pp

Overview

Parameters:

  • drbd_role (Any)
  • cluster_iface (Any)
  • cluster_ip (Any)
  • critical (Any) (defaults to: false)
  • resource (Any) (defaults to: 'all')
  • contact_groups (Any) (defaults to: 'wmcs-team')


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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# File 'modules/labstore/manifests/monitoring/primary.pp', line 12

class labstore::monitoring::primary(
    $drbd_role,
    $cluster_iface,
    $cluster_ip,
    $critical=false,
    $resource = 'all',
    $contact_groups='wmcs-team',
    ) {

    sudo::user { 'nagios_check_drbd':
        user       => 'nagios',
        privileges => [
                      'ALL = NOPASSWD: /usr/local/sbin/check_drbd_status',
                      'ALL = NOPASSWD: /usr/local/sbin/check_drbd_role',
                      'ALL = NOPASSWD: /usr/local/sbin/check_drbd_cluster_ip',
                      ],
    }

    file { '/usr/local/sbin/check_drbd_status':
        source => 'puppet:///modules/labstore/monitor/check_drbd_status.py',
        mode   => '0755',
        owner  => 'root',
        group  => 'root',
    }

    nrpe::monitor_service { 'check_drbd_status':
        critical      => $critical,
        description   => 'DRBD node status',
        nrpe_command  => "/usr/bin/sudo /usr/local/sbin/check_drbd_status ${resource}",
        contact_group => $contact_groups,
        require       => File['/usr/local/sbin/check_drbd_status'],
        notes_url     => 'https://wikitech.wikimedia.org/wiki/Portal:Data_Services/Admin/Labstore',
    }

    file { '/usr/local/sbin/check_drbd_role':
        source => 'puppet:///modules/labstore/monitor/check_drbd_role.py',
        mode   => '0755',
        owner  => 'root',
        group  => 'root',
    }

    nrpe::monitor_service { 'check_drbd_role':
        critical      => $critical,
        description   => 'DRBD role',
        nrpe_command  => "/usr/bin/sudo /usr/local/sbin/check_drbd_role ${::hostname} ${drbd_role}",
        contact_group => $contact_groups,
        require       => File['/usr/local/sbin/check_drbd_role'],
        notes_url     => 'https://wikitech.wikimedia.org/wiki/Portal:Data_Services/Admin/Labstore',
    }

    file { '/usr/local/sbin/check_drbd_cluster_ip':
        source => 'puppet:///modules/labstore/monitor/check_drbd_cluster_ip.py',
        mode   => '0755',
        owner  => 'root',
        group  => 'root',
    }

    nrpe::monitor_service { 'check_drbd_cluster_ip':
        critical      => $critical,
        description   => 'DRBD Cluster IP assignment',
        nrpe_command  => "/usr/bin/sudo /usr/local/sbin/check_drbd_cluster_ip ${::hostname} ${drbd_role} ${cluster_iface} ${cluster_ip}",
        contact_group => $contact_groups,
        require       => File['/usr/local/sbin/check_drbd_cluster_ip'],
        notes_url     => 'https://wikitech.wikimedia.org/wiki/Portal:Data_Services/Admin/Labstore',
    }

    nrpe::monitor_service { 'check_nfs_status':
        description   => 'NFS port is open on cluster IP',
        nrpe_command  => "/usr/lib/nagios/plugins/check_tcp -H ${cluster_ip} -p 2049 --timeout=2",
        contact_group => $contact_groups,
        notes_url     => 'https://wikitech.wikimedia.org/wiki/Portal:Data_Services/Admin/Labstore',
    }
}