2019-10-06 20:55:56 +00:00
|
|
|
[agent]
|
2019-11-12 20:06:04 +00:00
|
|
|
interval = "{{ telegraf_interval }}"
|
2019-10-06 20:55:56 +00:00
|
|
|
hostname = ""
|
|
|
|
|
|
|
|
[[outputs.influxdb]]
|
2019-11-12 20:06:04 +00:00
|
|
|
urls = ["{{ telegraf_server_url }}"]
|
2019-10-06 20:55:56 +00:00
|
|
|
database = "servers"
|
|
|
|
skip_database_creation = true
|
|
|
|
|
|
|
|
## Name of existing retention policy to write to.
|
|
|
|
retention_policy = ""
|
|
|
|
|
|
|
|
## Write timeout (for the InfluxDB client), formatted as a string.
|
|
|
|
timeout = "5s"
|
2019-11-12 20:06:04 +00:00
|
|
|
username = "{{ telegraf_server_user }}"
|
|
|
|
password = "{{ telegraf_server_passwd }}"
|
2019-10-06 20:55:56 +00:00
|
|
|
|
|
|
|
|
|
|
|
# Read metrics about cpu usage
|
|
|
|
[[inputs.cpu]]
|
|
|
|
percpu = false
|
|
|
|
totalcpu = true
|
|
|
|
collect_cpu_time = false ## If true, collect raw CPU time metrics
|
|
|
|
report_active = true ## If true, compute and report the sum of all non-idle CPU states.
|
|
|
|
|
|
|
|
fieldpass = ["usage_user", "usage_system", "usage_iowait", "usage_irq", "usage_active"]
|
|
|
|
|
|
|
|
# Read metrics about memory usage
|
|
|
|
[[inputs.mem]]
|
|
|
|
#fieldpass = ["total", "used_percent"]
|
|
|
|
|
|
|
|
# Read metrics about disk usage by mount point
|
|
|
|
[[inputs.disk]]
|
|
|
|
# By default, telegraf gather stats for all mountpoints.
|
2020-04-18 13:25:41 +00:00
|
|
|
mount_points = ["/", "/mnt/volume-nbg1-1"]
|
2019-10-06 20:55:56 +00:00
|
|
|
ignore_fs = ["tmpfs", "devtmpfs", "devfs", "overlay", "aufs", "squashfs"]
|
|
|
|
fieldpass = ["total", "free", "used_percent"]
|
|
|
|
|
|
|
|
# Read metrics about disk IO by device
|
|
|
|
[[inputs.diskio]]
|
|
|
|
## By default, telegraf will gather stats for all devices including partitions.
|
|
|
|
## Setting devices will restrict the stats to the specified devices.
|
|
|
|
devices = ["sd[a-d]", "mmcblk[0-1]", "ada[0-9]", "nvd[0-9]"]
|
|
|
|
## Uncomment the following line if you need disk serial numbers.
|
|
|
|
# skip_serial_number = false
|
|
|
|
fieldpass = ["read_bytes", "write_bytes", "io_time", "weighted_io_time", "iops_in_progress"]
|
|
|
|
|
|
|
|
# Read metrics about system load & uptime
|
|
|
|
[[inputs.system]]
|
|
|
|
# default config, pass all fields
|
|
|
|
|
|
|
|
# Get TCP connection state and UDP socket counts using lsof
|
|
|
|
[[inputs.netstat]]
|
|
|
|
fieldpass = ["tcp_established", "tcp_listen", "udp_socket"]
|
|
|
|
|
|
|
|
# Gather metrics about network interface and protocol usage (Linux only)
|
|
|
|
[[inputs.net]]
|
|
|
|
interfaces = ["eth*", "enp0s[0-1]"]
|
|
|
|
ignore_protocol_stats = true
|
|
|
|
fieldpass = ["bytes_sent", "bytes_recv"]
|
|
|
|
|
|
|
|
|
|
|
|
{% if telegraf_docker|default(false)|bool %}
|
|
|
|
{% include telegraf_docker_file %}
|
|
|
|
{% endif %}
|
|
|
|
|
2020-04-18 13:25:41 +00:00
|
|
|
{% include telegraf_unifi_file %}
|
2019-10-06 20:55:56 +00:00
|
|
|
|
|
|
|
|
|
|
|
# # Monitor sensors, requires lm-sensors package
|
|
|
|
# [[inputs.sensors]]
|
|
|
|
# ## Remove numbers from field names.
|
|
|
|
# ## If true, a field name like 'temp1_input' will be changed to 'temp_input'.
|
|
|
|
# # remove_numbers = true
|