Fixes nodeexporter
This commit is contained in:
parent
26d9357793
commit
baf56f0edb
2
main.tf
2
main.tf
|
@ -24,7 +24,6 @@ module "docker" {
|
|||
domain = "bb8.fun"
|
||||
}
|
||||
|
||||
|
||||
module "radicale" {
|
||||
source = "radicale"
|
||||
domain = "radicale.bb8.fun"
|
||||
|
@ -33,4 +32,5 @@ module "radicale" {
|
|||
module "monitoring" {
|
||||
source = "monitoring"
|
||||
gf-security-admin-password = "${var.gf-security-admin-password}"
|
||||
domain = "bb8.fun"
|
||||
}
|
||||
|
|
|
@ -11,7 +11,12 @@ scrape_configs:
|
|||
- job_name: "node"
|
||||
scrape_interval: 5s
|
||||
static_configs:
|
||||
- targets: ["node_exporter:9100"]
|
||||
- targets: ["nodeexporter:9100"]
|
||||
|
||||
- job_name: 'cadvisor'
|
||||
scrape_interval: 5s
|
||||
static_configs:
|
||||
- targets: ['cadvisor:8080']
|
||||
|
||||
rule_files:
|
||||
- "alert.rules"
|
||||
|
|
|
@ -13,4 +13,3 @@ data "docker_registry_image" "prometheus" {
|
|||
data "docker_registry_image" "nodeexporter" {
|
||||
name = "prom/node-exporter"
|
||||
}
|
||||
|
||||
|
|
|
@ -11,6 +11,7 @@ resource docker_container "grafana" {
|
|||
"traefik.frontend.headers.STSIncludeSubdomains" = "false"
|
||||
"traefik.frontend.headers.contentTypeNosniff" = "true"
|
||||
"traefik.frontend.headers.browserXSSFilter" = "true"
|
||||
|
||||
# "traefik.frontend.headers.customResponseHeaders" = "${var.xpoweredby}"
|
||||
# "traefik.frontend.headers.customFrameOptionsValue" = "${var.xfo_allow}"
|
||||
}
|
||||
|
@ -22,6 +23,11 @@ resource docker_container "grafana" {
|
|||
|
||||
links = ["prometheus"]
|
||||
|
||||
env = [
|
||||
"GF_SECURITY_ADMIN_PASSWORD=${var.gf-security-admin-password}",
|
||||
"GF_SERVER_ROOT_URL=https://grafana.${var.domain}",
|
||||
]
|
||||
|
||||
restart = "unless-stopped"
|
||||
destroy_grace_seconds = 10
|
||||
must_run = true
|
||||
|
@ -31,6 +37,9 @@ resource docker_container "prometheus" {
|
|||
name = "prometheus"
|
||||
image = "${docker_image.prometheus.latest}"
|
||||
|
||||
# prometheus:prometheus
|
||||
user = "985:983"
|
||||
|
||||
command = ["--config.file=/etc/prometheus/prometheus.yml"]
|
||||
|
||||
volumes {
|
||||
|
@ -43,7 +52,7 @@ resource docker_container "prometheus" {
|
|||
file = "/etc/prometheus/prometheus.yml"
|
||||
}
|
||||
|
||||
links = ["nodeexporter"]
|
||||
links = ["nodeexporter", "cadvisor"]
|
||||
|
||||
restart = "unless-stopped"
|
||||
destroy_grace_seconds = 10
|
||||
|
@ -73,11 +82,10 @@ resource docker_container "nodeexporter" {
|
|||
command = [
|
||||
"--path.procfs=/host/proc",
|
||||
"--path.sysfs=/host/sys",
|
||||
"--collector.filesystem.ignored-mount-points=\"^/(sys|proc|dev|host|etc)($$|/)\""
|
||||
"--collector.filesystem.ignored-mount-points=\"^/(sys|proc|dev|host|etc)($$|/)\"",
|
||||
]
|
||||
|
||||
restart = "unless-stopped"
|
||||
destroy_grace_seconds = 10
|
||||
must_run = true
|
||||
}
|
||||
|
||||
|
|
|
@ -1,20 +1,23 @@
|
|||
variable "gf-security-admin-password" {
|
||||
type = "string"
|
||||
}
|
||||
|
||||
# variable "email" {
|
||||
# type = "string"
|
||||
# }
|
||||
|
||||
# variable "domain" {
|
||||
# type = "string"
|
||||
# }
|
||||
variable "domain" {
|
||||
type = "string"
|
||||
}
|
||||
|
||||
variable "alert-slack-username" {
|
||||
default = "Prometheus"
|
||||
}
|
||||
|
||||
variable "alert-slack-channel" {
|
||||
default = "#notifications"
|
||||
}
|
||||
|
||||
variable "alert-slack-incoming-webhook" {
|
||||
default = "https://hooks.slack.com/whatever"
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue