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
46
47
48
49
50
51
52
|
# File 'modules/profile/manifests/phabricator/monitoring.pp', line 3
class profile::phabricator::monitoring (
Stdlib::Fqdn $active_server = lookup('phabricator_server'),
Stdlib::Ensure::Service $phd_service_ensure = lookup('profile::phabricator::main::phd_service_ensure', {'default_value' => '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 {
default:
contact_group => $phab_contact_groups,
critical => true,
host => 'phabricator.wikimedia.org',
notes_url => 'https://wikitech.wikimedia.org/wiki/Phabricator';
'phabricator-https':
description => 'https://phabricator.wikimedia.org',
check_command => 'check_https_phabricator';
'phabricator-https-expiry':
description => 'https://phabricator.wikimedia.org certificate expiry',
check_command => 'check_https_expiry!phabricator.wikimedia.org!443';
}
prometheus::blackbox::check::http { 'phabricator.wikimedia.org': }
}
}
|