Skip to content

Instantly share code, notes, and snippets.

@naviat
Forked from mlabouardy/02-config-file.config
Created August 1, 2018 16:35
Show Gist options
  • Save naviat/7fbad5a5df8bee1b37d7d701f12aa190 to your computer and use it in GitHub Desktop.
Save naviat/7fbad5a5df8bee1b37d7d701f12aa190 to your computer and use it in GitHub Desktop.
Telegraf configuration file
files:
"/etc/telegraf/telegraf.conf":
mode: "000666"
owner: root
group: root
content: |
[global_tags]
hostname="Avengers"
# Read metrics about CPU usage
[[inputs.cpu]]
percpu = false
totalcpu = true
fieldpass = [ "usage*" ]
name_suffix = "_vm"
# Read metrics about disk usagee
[[inputs.disk]]
fielddrop = [ "inodes*" ]
mount_points=["/"]
name_suffix = "_vm"
# Read metrics about network usage
[[inputs.net]]
interfaces = [ "eth0", "eth1" ]
fielddrop = [ "icmp*", "ip*", "tcp*", "udp*" ]
name_suffix = "_vm"
# Read metrics about memory usage
[[inputs.mem]]
name_suffix = "_vm"
# Read metrics about swap memory usage
[[inputs.swap]]
name_suffix = "_vm"
# Read metrics about system load and uptime
[[inputs.system]]
name_suffix = "_vm"
# Read metrics from docker socket api
[[inputs.docker]]
endpoint = "unix:///var/run/docker.sock"
container_names = []
name_suffix = "_docker"
[[outputs.influxdb]]
database = "instances"
urls = ["http://172.31.38.51:8086"]
namepass = ["*_vm"]
[[outputs.influxdb]]
database = "containers"
urls = ["http://172.31.38.51:8086"]
namepass = ["*_docker"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment