extract telegraf from monitoring to run int on multible docker hosts
This commit is contained in:
parent
118c050be9
commit
b3c96687c3
6 changed files with 48 additions and 40 deletions
|
@ -70,46 +70,6 @@ services:
|
|||
- "traefik.docker.network=web"
|
||||
- "docker.group=monitoring"
|
||||
|
||||
|
||||
##################################################################
|
||||
# here starts data collection
|
||||
|
||||
telegraf_host:
|
||||
image: telegraf:1.18
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
- HOST_MOUNT_PREFIX=/hostfs
|
||||
- HOST_PROC=/hostfs/proc
|
||||
- HOST_SYS=/hostfs/sys
|
||||
- HOST_ETC=/hostfs/etc
|
||||
- HOST_VAR=/hostfs/var
|
||||
- HOST_RUN=/hostfs/run
|
||||
volumes:
|
||||
- ./telegraf/telegraf_host.conf:/etc/telegraf/telegraf.conf:ro
|
||||
- /var/run/utmp:/var/run/utmp:ro
|
||||
- /:/hostfs:ro
|
||||
network_mode: "host"
|
||||
labels:
|
||||
- "docker.group=monitoring"
|
||||
depends_on:
|
||||
- influxdb
|
||||
|
||||
|
||||
telegraf_net:
|
||||
image: telegraf:1.18
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- ./telegraf/telegraf_net.conf:/etc/telegraf/telegraf.conf:ro
|
||||
networks:
|
||||
- monitoring
|
||||
- dockersocket
|
||||
labels:
|
||||
- "docker.group=monitoring"
|
||||
depends_on:
|
||||
- influxdb
|
||||
dns:
|
||||
- 192.168.16.5
|
||||
|
||||
networks:
|
||||
monitoring:
|
||||
web:
|
||||
|
|
36
telegraf/docker-compose.yaml
Normal file
36
telegraf/docker-compose.yaml
Normal file
|
@ -0,0 +1,36 @@
|
|||
version: "3.3"
|
||||
services:
|
||||
|
||||
host:
|
||||
image: telegraf:1.18
|
||||
restart: unless-stopped
|
||||
environment:
|
||||
- HOST_MOUNT_PREFIX=/hostfs
|
||||
- HOST_PROC=/hostfs/proc
|
||||
- HOST_SYS=/hostfs/sys
|
||||
- HOST_ETC=/hostfs/etc
|
||||
- HOST_VAR=/hostfs/var
|
||||
- HOST_RUN=/hostfs/run
|
||||
volumes:
|
||||
- ./telegraf_host.conf:/etc/telegraf/telegraf.conf:ro
|
||||
- /var/run/utmp:/var/run/utmp:ro
|
||||
- /:/hostfs:ro
|
||||
network_mode: "host"
|
||||
labels:
|
||||
- "docker.group=telegraf"
|
||||
|
||||
net:
|
||||
image: telegraf:1.18
|
||||
restart: unless-stopped
|
||||
volumes:
|
||||
- ./telegraf_net.conf:/etc/telegraf/telegraf.conf:ro
|
||||
networks:
|
||||
- dockersocket
|
||||
labels:
|
||||
- "docker.group=telegraf"
|
||||
dns:
|
||||
- ${LOCAL_DNS_SERVER}
|
||||
|
||||
networks:
|
||||
dockersocket:
|
||||
external: true
|
12
telegraf/influxdb.conf
Normal file
12
telegraf/influxdb.conf
Normal file
|
@ -0,0 +1,12 @@
|
|||
[meta]
|
||||
dir = "/var/lib/influxdb/meta"
|
||||
|
||||
[data]
|
||||
dir = "/var/lib/influxdb/data"
|
||||
wal-dir = "/var/lib/influxdb/wal"
|
||||
max-concurrent-compactions = 1
|
||||
|
||||
[monitor]
|
||||
store-enabled = false
|
||||
store-database = "_internal"
|
||||
store-interval = "10s"
|
Loading…
Reference in a new issue