updated system-monitoring

This commit is contained in:
dominikhoebert 2024-08-12 18:42:35 +02:00
parent be167256a3
commit ee0da61e8d
5 changed files with 56 additions and 17 deletions

1
.gitignore vendored
View File

@ -55,3 +55,4 @@ audiobookshelf/audiobooks/
audiobookshelf/config/ audiobookshelf/config/
audiobookshelf/metadata/ audiobookshelf/metadata/
audiobookshelf/podcasts/ audiobookshelf/podcasts/
system-monitoring/grafana/storage/

View File

@ -1,8 +0,0 @@
# System monitoring using telegraf and influxdb
1. Run the compose `docker-compose up -d`
2. Open [http://localhost:8086](http://localhost:8086) in the browser
3. Create a username and password, name your organization `tgm` and your first bucket `telegraf-bucket`
4. Choose quick start -> add data source -> Telegraf
5. Create a token and paste it in `telegraf/telegraf.conf`
6. Restart stack using `docker-compose up -d`

View File

@ -10,8 +10,15 @@ services:
- ./influxdb/config:/etc/influxdb2 - ./influxdb/config:/etc/influxdb2
restart: unless-stopped restart: unless-stopped
image: influxdb:2.1.1 image: influxdb:2.1.1
networks: environment:
- proxy - DOCKER_INFLUXDB_INIT_MODE=setup
- DOCKER_INFLUXDB_INIT_USERNAME=schueler
- DOCKER_INFLUXDB_INIT_PASSWORD=example-password
- DOCKER_INFLUXDB_INIT_ORG=telegraf
- DOCKER_INFLUXDB_INIT_BUCKET=telegraf-bucket
- DOCKER_INFLUXDB_INIT_ADMIN_TOKEN=t3S9_jBwHAUNwB4J_SD6p_hjBKmtFsrE1pKlx8CIm2vOkIV46-TrtmAncHzg9yHB6xIoqkvJRxWD_UiDjd_wnw==
# networks:
# - proxy
# https://www.influxdata.com/time-series-platform/telegraf/ # https://www.influxdata.com/time-series-platform/telegraf/
telegraf: telegraf:
container_name: telegraf container_name: telegraf
@ -20,9 +27,33 @@ services:
- influxdb - influxdb
volumes: volumes:
- ./telegraf/telegraf.conf:/etc/telegraf/telegraf.conf:ro - ./telegraf/telegraf.conf:/etc/telegraf/telegraf.conf:ro
networks: - /var/run/docker.sock:/var/run/docker.sock:ro
- proxy - /sys:/rootfs/sys:ro
- /proc:/rootfs/proc:ro
- /etc:/rootfs/etc:ro
environment:
HOST_PROC: /rootfs/proc
HOST_SYS: /rootfs/sys
HOST_ETC: /rootfs/etc
# networks:
# - proxy
grafana:
container_name: grafana
image: grafana/grafana:latest
environment:
- GF_AUTH_ANONYMOUS_ORG_ROLE=Admin
- GF_AUTH_ANONYMOUS_ENABLED=true
- GF_AUTH_BASIC_ENABLED=false
- GF_PATHS_PROVISIONING=/etc/grafana/provisioning
- GF_INSTALL_PLUGINS=grafana-simple-json-datasource
ports:
- 3033:3000/tcp
volumes:
- ./grafana/provisioning:/etc/grafana/provisioning
- ./grafana/storage:/var/lib/grafana
# networks:
# - proxy
networks: # networks:
proxy: # proxy:
external: true # external: true

View File

@ -0,0 +1,15 @@
apiVersion: 1
datasources:
- name: InfluxDB
type: influxdb
access: proxy
url: http://influxdb:8086
isDefault: true
jsonData:
version: Flux
organization: telegraf
defaultBucket: telegraf-bucket
tlsSkipVerify: true
secureJsonData:
token: t3S9_jBwHAUNwB4J_SD6p_hjBKmtFsrE1pKlx8CIm2vOkIV46-TrtmAncHzg9yHB6xIoqkvJRxWD_UiDjd_wnw==

View File

@ -14,8 +14,8 @@
[[outputs.influxdb_v2]] [[outputs.influxdb_v2]]
urls = ["http://influxdb:8086"] urls = ["http://influxdb:8086"]
token = "FILL_ME_IN_AFTER_CREATING" token = "t3S9_jBwHAUNwB4J_SD6p_hjBKmtFsrE1pKlx8CIm2vOkIV46-TrtmAncHzg9yHB6xIoqkvJRxWD_UiDjd_wnw=="
organization = "tgm" organization = "telegraf"
bucket = "telegraf-bucket" bucket = "telegraf-bucket"