refactoring
This commit is contained in:
102
docker/telegraf/config/telegraf.conf
Normal file
102
docker/telegraf/config/telegraf.conf
Normal file
@@ -0,0 +1,102 @@
|
||||
[global_tags]
|
||||
# dc = "us-east-1" # will tag all metrics with dc=us-east-1
|
||||
# rack = "1a"
|
||||
## Environment variables can be used as tags, and throughout the config file
|
||||
# user = "$USER"
|
||||
|
||||
|
||||
|
||||
[agent]
|
||||
hostname = "homesrv01"
|
||||
omit_hostname = false
|
||||
interval = "10s"
|
||||
round_interval = true
|
||||
metric_batch_size = 1000
|
||||
metric_buffer_limit = 10000
|
||||
collection_jitter = "0s"
|
||||
flush_interval = "10s"
|
||||
flush_jitter = "0s"
|
||||
precision = "0s"
|
||||
|
||||
|
||||
|
||||
# Output Configuration for telegraf agent
|
||||
[[outputs.influxdb_v2]]
|
||||
## The URLs of the InfluxDB cluster nodes.
|
||||
##
|
||||
## Multiple URLs can be specified for a single cluster, only ONE of the
|
||||
## urls will be written to each interval.
|
||||
## urls exp: http://127.0.0.1:8086
|
||||
urls = ["http://influxdb01.lan:8086"]
|
||||
## Token for authentication.
|
||||
token = "V9iMrHJvI42_KcV0tcH5X3DcUEhvFQdnX5JqlBiKRsHEZMDDZQYdtxIuXlGzQTofUiLXc_QJN1pjpqnM6Fr1ow=="
|
||||
## Organization is the name of the organization you wish to write to; must exist.
|
||||
organization = "limbo"
|
||||
## Destination bucket to write into.
|
||||
bucket = "telegraf"
|
||||
insecure_skip_verify = true
|
||||
|
||||
|
||||
[[inputs.docker]]
|
||||
endpoint = "unix:///var/run/docker.sock"
|
||||
gather_services = false
|
||||
container_names = []
|
||||
source_tag = false
|
||||
container_name_include = []
|
||||
container_name_exclude = []
|
||||
timeout = "5s"
|
||||
perdevice = true
|
||||
total = false
|
||||
docker_label_include = []
|
||||
docker_label_exclude = []
|
||||
tag_env = ["JAVA_HOME", "HEAP_SIZE"]
|
||||
|
||||
# Read metrics about cpu usage
|
||||
[[inputs.cpu]]
|
||||
## Whether to report per-cpu stats or not
|
||||
percpu = true
|
||||
## Whether to report total system cpu stats or not
|
||||
totalcpu = true
|
||||
## If true, collect raw CPU time metrics
|
||||
collect_cpu_time = false
|
||||
## If true, compute and report the sum of all non-idle CPU states
|
||||
report_active = false
|
||||
|
||||
|
||||
# Read metrics about disk usage by mount point
|
||||
[[inputs.disk]]
|
||||
## By default stats will be gathered for all mount points.
|
||||
## Set mount_points will restrict the stats to only the specified mount points.
|
||||
# mount_points = ["/"]
|
||||
|
||||
## Ignore mount points by filesystem type.
|
||||
ignore_fs = ["tmpfs", "devtmpfs", "devfs", "iso9660", "overlay", "aufs", "squashfs"]
|
||||
|
||||
[[inputs.diskio]]
|
||||
|
||||
[[inputs.kernel]]
|
||||
|
||||
[[inputs.mem]]
|
||||
|
||||
# Get the number of processes and group them by status
|
||||
[[inputs.processes]]
|
||||
# no configuration
|
||||
|
||||
|
||||
# Read metrics about swap memory usage
|
||||
[[inputs.swap]]
|
||||
# no configuration
|
||||
|
||||
|
||||
# Read metrics about system load & uptime
|
||||
[[inputs.system]]
|
||||
# no configuration
|
||||
|
||||
|
||||
# Read metrics about network interface usage
|
||||
[[inputs.net]]
|
||||
## By default, telegraf gathers stats from any up interface (excluding loopback)
|
||||
## Setting interfaces will tell it to gather these explicit interfaces,
|
||||
## regardless of status.
|
||||
##
|
||||
interfaces = ["eth0"]
|
||||
18
docker/telegraf/docker-run.sh
Executable file
18
docker/telegraf/docker-run.sh
Executable file
@@ -0,0 +1,18 @@
|
||||
#! /bin/bash
|
||||
# must be executed from repo/docker/telegraf
|
||||
docker pull telegraf
|
||||
docker container stop telegraf
|
||||
docker container remove telegraf
|
||||
|
||||
|
||||
docker run -d --name=telegraf \
|
||||
-v /var/run/docker.sock:/var/run/docker.sock \
|
||||
-v ./config/telegraf.conf:/etc/telegraf/telegraf.conf \
|
||||
-v /:/hostfs:ro \
|
||||
-e HOST_ETC=/hostfs/etc \
|
||||
-e HOST_PROC=/hostfs/proc \
|
||||
-e HOST_SYS=/hostfs/sys \
|
||||
-e HOST_VAR=/hostfs/var \
|
||||
-e HOST_RUN=/hostfs/run \
|
||||
-e HOST_MOUNT_PREFIX=/hostfs \
|
||||
telegraf
|
||||
Reference in New Issue
Block a user