71 lines
1.2 KiB
HCL
71 lines
1.2 KiB
HCL
job "node-exporter" {
|
|
region = "global"
|
|
datacenters = ["dc1"]
|
|
type = "system"
|
|
|
|
constraint {
|
|
attribute = "${attr.kernel.name}"
|
|
value = "linux"
|
|
}
|
|
|
|
group "node-exporter" {
|
|
count = 1
|
|
|
|
restart {
|
|
attempts = 3
|
|
delay = "20s"
|
|
mode = "delay"
|
|
}
|
|
|
|
task "node-exporter" {
|
|
driver = "docker"
|
|
|
|
config {
|
|
#image = "anzevalher/node-exporter"
|
|
image = "prom/node-exporter"
|
|
|
|
force_pull = true
|
|
|
|
args = ["--collector.cpu","--collector.filesystem","--collector.meminfo","--collector.thermal_zone","--collector.disable-defaults",]
|
|
volumes = [
|
|
"/proc:/host/proc",
|
|
"/sys:/host/sys",
|
|
"/:/rootfs",
|
|
]
|
|
|
|
port_map {
|
|
http = 9100
|
|
}
|
|
}
|
|
|
|
service {
|
|
name = "node-exporter"
|
|
|
|
tags = [
|
|
"metrics",
|
|
]
|
|
|
|
port = "http"
|
|
|
|
check {
|
|
type = "http"
|
|
path = "/metrics/"
|
|
interval = "10s"
|
|
timeout = "2s"
|
|
}
|
|
}
|
|
|
|
resources {
|
|
cpu = 20
|
|
memory = 20
|
|
|
|
network {
|
|
port "http" {
|
|
static = "9100"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|