This repository has been archived by the owner on Jan 30, 2024. It is now read-only.
/
checks.pp
131 lines (119 loc) · 5.51 KB
/
checks.pp
1
2
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
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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
# == Class: govuk::apps::email_alert_api:checks
#
# Various Icinga checks for Email Alert API.
#
class govuk::apps::email_alert_api::checks(
$ensure = present,
) {
delivery_attempt_status_check { 'internal_failure':
ensure => $ensure,
}
delivery_attempt_status_check { 'technical_failure':
ensure => $ensure,
}
@@icinga::check::graphite { 'email-alert-api-notify-email-send-request-success':
host_name => $::fqdn,
target => 'summarize(sum(stats_counts.govuk.app.email-alert-api.*.notify.email_send_request.success),"1day")',
args => '--ignore-missing',
warning => '3200000', # 4,000,000 * 0.8
critical => '3600000', # 4,000,000 * 0.9
from => '3hours',
desc => 'email-alert-api - high number of email send requests',
}
@@icinga::check::graphite { 'email-alert-api-delivery-attempt-status-update':
ensure => $ensure,
host_name => $::fqdn,
target => 'transformNull(divideSeries(keepLastValue(stats.gauges.govuk.email-alert-api.delivery_attempt.pending_status_total), keepLastValue(stats.gauges.govuk.email-alert-api.delivery_attempt.total)),0)',
warning => '0.166',
critical => '0.25',
from => '1hour',
desc => 'email-alert-api - high number of delivery attempts have not received status updates',
notes_url => monitoring_docs_url(email-alert-api-delivery-attempts-status-updates),
}
# We are only interested in the `warning` state but `critical` is also required
# for valid Icinga check configuration. Setting it to a high value that won't be
# reached allows us to get round this issue
@@icinga::check::graphite { 'email-alert-api-warning-subscription-contents':
ensure => $ensure,
host_name => $::fqdn,
target => 'transformNull(keepLastValue(stats.gauges.govuk.email-alert-api.subscription_contents.warning_total))',
warning => '0',
critical => '100000000',
from => '1hour',
desc => 'email-alert-api - unprocessed subscription contents - warning',
notes_url => monitoring_docs_url(email-alert-api-unprocessed-subscription-contents),
}
@@icinga::check::graphite { 'email-alert-api-warning-content-changes':
ensure => $ensure,
host_name => $::fqdn,
target => 'transformNull(keepLastValue(stats.gauges.govuk.email-alert-api.content_changes.warning_total))',
warning => '0',
critical => '100000000',
from => '1hour',
desc => 'email-alert-api - unprocessed content changes - warning',
notes_url => monitoring_docs_url(email-alert-api-unprocessed-content-changes),
}
@@icinga::check::graphite { 'email-alert-api-warning-digest-runs':
ensure => $ensure,
host_name => $::fqdn,
target => 'transformNull(keepLastValue(stats.gauges.govuk.email-alert-api.digest_runs.warning_total))',
warning => '0',
critical => '100000000',
from => '1hour',
desc => 'email-alert-api - incomplete digest runs - warning',
notes_url => monitoring_docs_url(email-alert-api-incomplete-digest-runs),
}
@@icinga::check::graphite { 'email-alert-api-warning-messages':
ensure => $ensure,
host_name => $::fqdn,
target => 'transformNull(keepLastValue(stats.gauges.govuk.email-alert-api.messages.warning_total))',
warning => '0',
critical => '100000000',
from => '1hour',
desc => 'email-alert-api - unprocessed messages - warning',
notes_url => monitoring_docs_url(email-alert-api-unprocessed-messages),
}
# We are only interested in the `critical` state but `warning` is also required
# for valid Icinga check configuration. Both states are set to 0 but `critical`
# takes precedence and allows us to get round this issue
@@icinga::check::graphite { 'email-alert-api-critical-subscription-contents':
ensure => $ensure,
host_name => $::fqdn,
target => 'transformNull(keepLastValue(stats.gauges.govuk.email-alert-api.subscription_contents.critical_total))',
warning => '0',
critical => '0',
from => '1hour',
desc => 'email-alert-api - unprocessed subscription contents - critical',
notes_url => monitoring_docs_url(email-alert-api-unprocessed-subscription-contents),
}
@@icinga::check::graphite { 'email-alert-api-critical-content-changes':
ensure => $ensure,
host_name => $::fqdn,
target => 'transformNull(keepLastValue(stats.gauges.govuk.email-alert-api.content_changes.critical_total))',
warning => '0',
critical => '0',
from => '1hour',
desc => 'email-alert-api - unprocessed content changes - critical',
notes_url => monitoring_docs_url(email-alert-api-unprocessed-content-changes),
}
@@icinga::check::graphite { 'email-alert-api-critical-digest-runs':
ensure => $ensure,
host_name => $::fqdn,
target => 'transformNull(keepLastValue(stats.gauges.govuk.email-alert-api.digest_runs.critical_total))',
warning => '0',
critical => '0',
from => '1hour',
desc => 'email-alert-api - incomplete digest runs - critical',
notes_url => monitoring_docs_url(email-alert-api-incomplete-digest-runs),
}
@@icinga::check::graphite { 'email-alert-api-critical-messages':
ensure => $ensure,
host_name => $::fqdn,
target => 'transformNull(keepLastValue(stats.gauges.govuk.email-alert-api.messages.critical_total))',
warning => '0',
critical => '0',
from => '1hour',
desc => 'email-alert-api - unprocessed messages - critical',
notes_url => monitoring_docs_url(email-alert-api-unprocessed-messages),
}
}