-
Notifications
You must be signed in to change notification settings - Fork 3
/
reboot.tf
36 lines (32 loc) · 1.2 KB
/
reboot.tf
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
locals {
reboot_filter = coalesce(
var.reboot_filter_override,
var.filter_str
)
}
module "reboot" {
source = "kabisa/generic-monitor/datadog"
version = "1.0.0"
name = "Sytem - Reboot detected"
query = "min(last_5m):derivative(max:system.uptime{${local.reboot_filter}} by {${var.alert_by}}) < 0"
alert_message = "Reboot detected on ${var.service} Node {{${var.alert_by}.name}}"
recovery_message = ""
require_full_window = false
# monitor level vars
enabled = var.reboot_enabled
alerting_enabled = var.reboot_alerting_enabled
# no warning
critical_threshold = 0
priority = min(var.reboot_priority + var.priority_offset, 5)
docs = var.reboot_docs
note = var.reboot_note
notification_channel = try(coalesce(var.reboot_notification_channel_override, var.notification_channel), "")
# module level vars
env = var.env
service = var.service
service_display_name = var.service_display_name
additional_tags = var.additional_tags
locked = var.locked
name_prefix = var.name_prefix
name_suffix = var.name_suffix
}