Puppet Class: profile::phabricator::monitoring

Defined in:
modules/profile/manifests/phabricator/monitoring.pp

Overview

Class: profile::phabricator::monitoring

Parameters:

  • active_server (Stdlib::Fqdn) (defaults to: hiera('phabricator_server'))
  • phd_service_ensure (Stdlib::Ensure::Service) (defaults to: hiera('profile::phabricator::main::phd_service_ensure', 'running'))


3
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
# File 'modules/profile/manifests/phabricator/monitoring.pp', line 3

class profile::phabricator::monitoring (
    Stdlib::Fqdn $active_server = hiera('phabricator_server'),
    Stdlib::Ensure::Service $phd_service_ensure = hiera('profile::phabricator::main::phd_service_ensure', 'running'),
){

    # All checks are paging because the "sms" contact group is added.
    # Only monitor PHD if it is actually set to be running in Hiera.
    if $phd_service_ensure == 'running' {

        $phab_contact_groups = 'admins,phabricator'

        nrpe::monitor_service { 'check_phab_taskmaster':
            description   => 'PHD should be supervising processes',
            nrpe_command  => '/usr/lib/nagios/plugins/check_procs -c 3:150 -u phd',
            contact_group => $phab_contact_groups,
            notes_url     => 'https://wikitech.wikimedia.org/wiki/Phabricator',
        }

        nrpe::monitor_service { 'check_phab_phd':
            description   => 'PHD should be running',
            nrpe_command  => "/usr/lib/nagios/plugins/check_procs -c 1: --ereg-argument-array  'php ./phd-daemon' -u phd",
            contact_group => $phab_contact_groups,
            notes_url     => 'https://wikitech.wikimedia.org/wiki/Phabricator',
        }
    }

    # https monitoring is on the virtual host 'phabricator'.
    # It should not be duplicated.
    if $::fqdn == $active_server {
        monitoring::host { 'phabricator.wikimedia.org':
            host_fqdn => 'phabricator.wikimedia.org',
        }

        monitoring::service { 'phabricator-https':
            description   => 'https://phabricator.wikimedia.org',
            check_command => 'check_https_phabricator',
            contact_group => $phab_contact_groups,
            critical      => true,
            host          => 'phabricator.wikimedia.org',
            notes_url     => 'https://wikitech.wikimedia.org/wiki/Phabricator',
        }
    }
}