Merged in MON-287_fix_service_check_monitors (pull request #127)

MON-287 update service check monitors configuration

Approved-by: Alexandre Gaillet <alexandre.gaillet@fr.clara.net>
Approved-by: Quentin Manfroi <quentin.manfroi@yahoo.fr>
Approved-by: SJ <sjeoffroi@morea.fr>
Approved-by: Rafael Romero Carmona <rafael.romero.carmona@fr.clara.net>
This commit is contained in:
Quentin Manfroi 2018-08-20 15:55:07 +00:00
commit 700adb2f6f
8 changed files with 37 additions and 28 deletions

View File

@ -16,14 +16,15 @@ module "datadog-monitors-middleware-apache" {
Creates DataDog monitors with the following checks:
- Can't connect to apache vhost status
- Apache vhost status does not respond
## Inputs
| Name | Description | Type | Default | Required |
|------|-------------|:----:|:-----:|:-----:|
| apache_connect_message | Custom message for Apache process monitor | string | `` | no |
| apache_connect_silenced | Groups to mute for Apache process monitor | map | `<map>` | no |
| apache_connect_message | Custom message for Apache status monitor | string | `` | no |
| apache_connect_silenced | Groups to mute for Apache status monitor | map | `<map>` | no |
| apache_connect_threshold_critical | Apache status monitor (critical threshold) | string | `1.1754943508222875e-38` | no |
| delay | Delay in seconds for the metric evaluation | string | `15` | no |
| environment | Architecture Environment | string | - | yes |
| filter_tags_custom | Tags used for custom filtering when filter_tags_use_defaults is false | string | `*` | no |

View File

@ -27,13 +27,19 @@ variable "filter_tags_custom" {
# Apache Middleware specific
variable "apache_connect_silenced" {
description = "Groups to mute for Apache process monitor"
description = "Groups to mute for Apache status monitor"
type = "map"
default = {}
}
variable "apache_connect_message" {
description = "Custom message for Apache process monitor"
description = "Custom message for Apache status monitor"
type = "string"
default = ""
}
variable "apache_connect_threshold_critical" {
description = "Apache status monitor (critical threshold)"
type = "string"
default = 1.1754943508222875e-38
}

View File

@ -1,21 +1,19 @@
resource "datadog_monitor" "datadog_apache_process" {
name = "[${var.environment}] Can't connect to apache vhost status"
name = "[${var.environment}] Apache vhost status does not respond"
message = "${coalesce(var.apache_connect_message, var.message)}"
type = "service check"
query = <<EOF
"apache.can_connect".over${module.filter-tags.service_check}.by("host","port").last(6).count_by_status()
"apache.can_connect".over${module.filter-tags.service_check}.by("host","port","server").last(1).pct_by_status()
EOF
thresholds = {
ok = 1
warning = 2
critical = 4
warning = 0
critical = "${var.apache_connect_threshold_critical}"
}
notify_no_data = true
evaluation_delay = "${var.delay}"
new_host_delay = "${var.delay}"
renotify_interval = 0
notify_audit = false

View File

@ -16,7 +16,7 @@ module "datadog-monitors-middleware-nginx" {
Creates DataDog monitors with the following checks:
- Can't connect to nginx vhost status
- Nginx vhost status does not respond
## Inputs
@ -27,8 +27,9 @@ Creates DataDog monitors with the following checks:
| filter_tags_custom | Tags used for custom filtering when filter_tags_use_defaults is false | string | `*` | no |
| filter_tags_use_defaults | Use default filter tags convention | string | `true` | no |
| message | Message sent when an alert is triggered | string | - | yes |
| nginx_connect_message | Custom message for Nginx process monitor | string | `` | no |
| nginx_connect_silenced | Groups to mute for Nginx process monitor | map | `<map>` | no |
| nginx_connect_message | Custom message for Nginx status monitor | string | `` | no |
| nginx_connect_silenced | Groups to mute for Nginx status monitor | map | `<map>` | no |
| nginx_connect_threshold_critical | Nginx status monitor (critical threshold) | string | `1.1754943508222875e-38` | no |
## Outputs

View File

@ -27,13 +27,19 @@ variable "filter_tags_custom" {
# Nginx Middleware specific
variable "nginx_connect_silenced" {
description = "Groups to mute for Nginx process monitor"
description = "Groups to mute for Nginx status monitor"
type = "map"
default = {}
}
variable "nginx_connect_message" {
description = "Custom message for Nginx process monitor"
description = "Custom message for Nginx status monitor"
type = "string"
default = ""
}
variable "nginx_connect_threshold_critical" {
description = "Nginx status monitor (critical threshold)"
type = "string"
default = 1.1754943508222875e-38
}

View File

@ -1,21 +1,19 @@
resource "datadog_monitor" "datadog_nginx_process" {
name = "[${var.environment}] Can't connect to nginx vhost status"
name = "[${var.environment}] Nginx vhost status does not respond"
message = "${coalesce(var.nginx_connect_message, var.message)}"
type = "service check"
query = <<EOF
"nginx.can_connect".over${module.filter-tags.service_check}.by("host","port").last(6).count_by_status()
"nginx.can_connect".over${module.filter-tags.service_check}.by("host","port","server").last(1).pct_by_status()
EOF
thresholds = {
ok = 1
warning = 2
critical = 4
warning = 0
critical = "${var.nginx_connect_threshold_critical}"
}
notify_no_data = true
evaluation_delay = "${var.delay}"
new_host_delay = "${var.delay}"
renotify_interval = 0
notify_audit = false

View File

@ -16,8 +16,8 @@ module "datadog-monitors-middleware-php-fpm" {
Creates DataDog monitors with the following checks:
- php_fpm busy worker
- Can't connect to php-fpm
- Php-fpm busy worker
- Php-fpm ping url does not respond
## Inputs

View File

@ -1,5 +1,5 @@
resource "datadog_monitor" "datadog_php_fpm_connect_idle" {
name = "[${var.environment}] php_fpm busy worker {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
name = "[${var.environment}] Php-fpm busy worker {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = "${coalesce(var.php_fpm_busy_message, var.message)}"
type = "metric alert"
@ -32,7 +32,7 @@ resource "datadog_monitor" "datadog_php_fpm_connect_idle" {
}
resource "datadog_monitor" "datadog_fpm_process" {
name = "[${var.environment}] Can't connect to php-fpm"
name = "[${var.environment}] Php-fpm ping url does not respond"
message = "${coalesce(var.php_fpm_connect_message, var.message)}"
type = "service check"
@ -44,11 +44,10 @@ resource "datadog_monitor" "datadog_fpm_process" {
thresholds = {
ok = 1
warning = 2
critical = 4
critical = 5
}
notify_no_data = true
evaluation_delay = "${var.delay}"
new_host_delay = "${var.delay}"
renotify_interval = 0
notify_audit = false