├── LICENSE ├── README.md ├── docker-compose.yml └── telegraf.conf /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 Thetips4you 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # How-To-Setup-Influxdb-Telegraf-And-Grafana-using-Docker-Compose 2 | How To Setup Influxdb Telegraf And Grafana using Docker Compose 3 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | 2 | version: '3.6' 3 | services: 4 | telegraf: 5 | image: telegraf 6 | container_name: telegraf 7 | restart: always 8 | volumes: 9 | - ./telegraf.conf:/etc/telegraf/telegraf.conf:ro 10 | depends_on: 11 | - influxdb 12 | links: 13 | - influxdb 14 | ports: 15 | - '8125:8125' 16 | 17 | influxdb: 18 | image: influxdb:1.8-alpine 19 | container_name: influxdb 20 | restart: always 21 | environment: 22 | - INFLUXDB_DB=influx 23 | - INFLUXDB_ADMIN_USER=admin 24 | - INFLUXDB_ADMIN_PASSWORD=admin 25 | ports: 26 | - '8086:8086' 27 | volumes: 28 | - influxdb_data:/var/lib/influxdb 29 | 30 | grafana: 31 | image: grafana/grafana 32 | container_name: grafana-server 33 | restart: always 34 | depends_on: 35 | - influxdb 36 | environment: 37 | - GF_SECURITY_ADMIN_USER=admin 38 | - GF_SECURITY_ADMIN_PASSWORD=admin 39 | - GF_INSTALL_PLUGINS= 40 | links: 41 | - influxdb 42 | ports: 43 | - '3000:3000' 44 | volumes: 45 | - grafana_data:/var/lib/grafana 46 | 47 | volumes: 48 | grafana_data: {} 49 | influxdb_data: {} 50 | 51 | 52 | -------------------------------------------------------------------------------- /telegraf.conf: -------------------------------------------------------------------------------- 1 | [global_tags] 2 | 3 | [agent] 4 | interval = "60s" 5 | round_interval = true 6 | metric_batch_size = 1000 7 | metric_buffer_limit = 10000 8 | collection_jitter = "0s" 9 | flush_interval = "10s" 10 | flush_jitter = "0s" 11 | precision = "" 12 | hostname = "192.xxx.0.xxx" 13 | omit_hostname = false 14 | 15 | [[outputs.influxdb]] 16 | urls = ["http://influxdb:8086"] 17 | database = "influx" 18 | timeout = "5s" 19 | username = "telegraf" 20 | password = "metricsmetricsmetricsmetrics" 21 | 22 | 23 | [[inputs.cpu]] 24 | percpu = true 25 | totalcpu = true 26 | collect_cpu_time = false 27 | report_active = false 28 | 29 | 30 | [[inputs.disk]] 31 | ignore_fs = ["tmpfs", "devtmpfs", "devfs", "iso9660", "overlay", "aufs", "squashfs"] 32 | 33 | 34 | [[inputs.diskio]] 35 | 36 | [[inputs.kernel]] 37 | 38 | [[inputs.mem]] 39 | 40 | [[inputs.processes]] 41 | 42 | [[inputs.swap]] 43 | 44 | [[inputs.system]] 45 | --------------------------------------------------------------------------------