MON-91 Added VPN state check
This commit is contained in:
parent
b53e5fa34e
commit
fa9a5c3b3d
1
cloud/aws/vpn/inputs.tf
Symbolic link
1
cloud/aws/vpn/inputs.tf
Symbolic link
@ -0,0 +1 @@
|
||||
../../../inputs.tf
|
||||
36
cloud/aws/vpn/monitors-vpn.tf
Normal file
36
cloud/aws/vpn/monitors-vpn.tf
Normal file
@ -0,0 +1,36 @@
|
||||
module "message" {
|
||||
source = "../../common/alerting-message"
|
||||
oncall_24x7 = "${var.hno_escalation_group}"
|
||||
oncall_office_hours = "${var.ho_escalation_group}"
|
||||
}
|
||||
|
||||
resource "datadog_monitor" "VPN_status" {
|
||||
name = "[${var.env}] VPN Down {{ tunnelipaddress }}"
|
||||
message = "${module.message.alerting-message}"
|
||||
|
||||
query = <<EOF
|
||||
avg(last_5m): (
|
||||
avg:aws.vpn.tunnel_state{tunnelipaddress:${var.vpn_tunnel_address[0]}} by {region}
|
||||
+ avg:aws.vpn.tunnel_state{tunnelipaddress:${var.vpn_tunnel_address[1]}} by {region}
|
||||
) == ${var.vpn_config["critical"]}
|
||||
EOF
|
||||
|
||||
type = "query alert"
|
||||
|
||||
thresholds {
|
||||
ok = "${var.vpn_config["ok"]}"
|
||||
critical = "${var.vpn_config["critical"]}"
|
||||
warning = "${var.vpn_config["warning"]}"
|
||||
}
|
||||
|
||||
notify_no_data = true
|
||||
renotify_interval = 15
|
||||
evaluation_delay = "${var.vpn_config["delay"]}"
|
||||
notify_audit = false
|
||||
timeout_h = 0
|
||||
include_tags = true
|
||||
locked = false
|
||||
require_full_window = true
|
||||
|
||||
tags = ["env: ${var.env}", "provider: aws", "resource: vpn"]
|
||||
}
|
||||
27
inputs.tf
27
inputs.tf
@ -60,6 +60,8 @@ variable "rds_cpu_threshold" {
|
||||
}
|
||||
|
||||
variable "rds_mem_threshold" {
|
||||
type = "map"
|
||||
|
||||
default = {
|
||||
warning = 20
|
||||
critical = 10
|
||||
@ -81,6 +83,8 @@ variable "elb_config" {
|
||||
}
|
||||
|
||||
variable "elb_5xx_threshold" {
|
||||
type = "map"
|
||||
|
||||
default = {
|
||||
warning = 5
|
||||
critical = 10
|
||||
@ -88,6 +92,8 @@ variable "elb_5xx_threshold" {
|
||||
}
|
||||
|
||||
variable "elb_4xx_threshold" {
|
||||
type = "map"
|
||||
|
||||
default = {
|
||||
warning = 5
|
||||
critical = 10
|
||||
@ -96,13 +102,32 @@ variable "elb_4xx_threshold" {
|
||||
|
||||
variable "elb_backend_latency" {
|
||||
description = "Average time elapsed after the request leaves the load balancer until a response is received. In seconds"
|
||||
|
||||
|
||||
default = {
|
||||
warning = 1
|
||||
critical = 5
|
||||
}
|
||||
}
|
||||
|
||||
## VPN
|
||||
variable "vpn_tunnel_address" {
|
||||
description = "List the VPN tunnels you want to monitor"
|
||||
type = "list"
|
||||
default = []
|
||||
}
|
||||
|
||||
variable "vpn_config" {
|
||||
description = "Ok means that both tunnels are up, warning means only one tunnel is up and critical means that both tunnels are down "
|
||||
type = "map"
|
||||
|
||||
default = {
|
||||
delay = 900
|
||||
warning = 1
|
||||
critical = 0
|
||||
ok = 2
|
||||
}
|
||||
}
|
||||
|
||||
##apache nginx php
|
||||
variable "dd_nginx" {
|
||||
default = "disabled"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user