Telegrammy bits - Requires a patch to vigil itself.
Some checks failed
Trunk Check / Trunk Check Runner (push) Failing after 2s
Some checks failed
Trunk Check / Trunk Check Runner (push) Failing after 2s
This commit is contained in:
parent
4482dbb3c6
commit
793568095e
5 changed files with 51 additions and 21 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -4,3 +4,4 @@
|
|||
/terraform.tfstate*
|
||||
/.terraform.tfstate*
|
||||
/.github/cache
|
||||
/terraform.tfvars
|
|
@ -20,6 +20,9 @@ locals {
|
|||
support_url = var.support_url
|
||||
custom_html = var.custom_html
|
||||
services = local.services_toml
|
||||
startup_notification = var.notify_on_startup
|
||||
telegram_bot_token = var.notify_telegram.token
|
||||
telegram_chat_id = var.notify_telegram.channel
|
||||
})
|
||||
vigil_toml_checksum = md5(local.vigil_toml)
|
||||
}
|
||||
|
|
|
@ -16,7 +16,20 @@ variable "docker_networks" {
|
|||
description = "Docker networks to connect the vigil service to"
|
||||
default = null
|
||||
}
|
||||
|
||||
variable "notify_on_startup" {
|
||||
type = bool
|
||||
description = "Whether to send a startup notifications"
|
||||
default = false
|
||||
}
|
||||
variable "notify_telegram" {
|
||||
type = object({
|
||||
token = string
|
||||
channel = string
|
||||
topic = optional(string, null)
|
||||
})
|
||||
description = "Telegram configuration"
|
||||
default = null
|
||||
}
|
||||
variable "monitored_services" {
|
||||
type = map(list(object({
|
||||
id = string
|
||||
|
@ -26,7 +39,6 @@ variable "monitored_services" {
|
|||
http_status_healthy_below = optional(number, 400)
|
||||
http_status_healthy_above = optional(number, 200)
|
||||
})))
|
||||
|
||||
}
|
||||
variable "page_title" {
|
||||
type = string
|
||||
|
|
|
@ -54,14 +54,14 @@ queue_nack_dead_above = 5000
|
|||
queue_loaded_retry_delay = 500
|
||||
|
||||
[notify]
|
||||
startup_notification = false
|
||||
startup_notification = ${startup_notification}
|
||||
reminder_interval = 600
|
||||
reminder_backoff_function = "linear"
|
||||
reminder_backoff_limit = 3
|
||||
|
||||
#[notify.telegram]
|
||||
#bot_token = "xxxxxxxxxx:xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
|
||||
#chat_id = "xxxxxxxxx"
|
||||
[notify.telegram]
|
||||
bot_token = "${telegram_bot_token}"
|
||||
chat_id = "${telegram_chat_id}"
|
||||
|
||||
[probe]
|
||||
|
||||
|
|
18
vigil.tf
18
vigil.tf
|
@ -9,7 +9,15 @@ module "vigil_nginx_config" {
|
|||
allow_non_ssl = true
|
||||
allow_ssl = false
|
||||
}
|
||||
|
||||
variable "telegram_token" {
|
||||
type = string
|
||||
}
|
||||
variable "telegram_channel" {
|
||||
type = string
|
||||
}
|
||||
variable "telegram_topic" {
|
||||
type = string
|
||||
}
|
||||
module "vigil" {
|
||||
source = "./modules/vigil"
|
||||
monitored_services = {
|
||||
|
@ -53,7 +61,7 @@ module "vigil" {
|
|||
id = "backup"
|
||||
label = "Backup Server"
|
||||
endpoints = [
|
||||
"icmp://backup.ti",
|
||||
#"icmp://backup.ti", # ??? Doesn't work?
|
||||
"tcp://backup.ti:22",
|
||||
"http://backup.ti",
|
||||
]
|
||||
|
@ -205,4 +213,10 @@ module "vigil" {
|
|||
docker_networks = [
|
||||
docker_network.loadbalancer
|
||||
]
|
||||
notify_on_startup = true
|
||||
notify_telegram = {
|
||||
token = var.telegram_token
|
||||
channel = var.telegram_channel
|
||||
topic = var.telegram_topic
|
||||
}
|
||||
}
|
Reference in a new issue