{"id":27442387,"url":"https://github.com/drpsychick/docker-telegraf","last_synced_at":"2025-06-29T06:33:00.124Z","repository":{"id":51353264,"uuid":"116570293","full_name":"DrPsychick/docker-telegraf","owner":"DrPsychick","description":"Telegraf based on alpine, fully configurable through ENV","archived":false,"fork":false,"pushed_at":"2025-03-18T19:48:00.000Z","size":97,"stargazers_count":1,"open_issues_count":3,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-15T00:32:35.876Z","etag":null,"topics":["12-factor","alpine","docker","telegraf"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/DrPsychick.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-01-07T14:05:23.000Z","updated_at":"2025-03-18T19:48:03.000Z","dependencies_parsed_at":"2024-05-09T23:21:22.600Z","dependency_job_id":"d03ad08e-a1c0-481f-83d4-9bc6d3844d09","html_url":"https://github.com/DrPsychick/docker-telegraf","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/DrPsychick/docker-telegraf","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DrPsychick%2Fdocker-telegraf","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DrPsychick%2Fdocker-telegraf/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DrPsychick%2Fdocker-telegraf/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DrPsychick%2Fdocker-telegraf/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DrPsychick","download_url":"https://codeload.github.com/DrPsychick/docker-telegraf/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DrPsychick%2Fdocker-telegraf/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262547149,"owners_count":23327116,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["12-factor","alpine","docker","telegraf"],"created_at":"2025-04-15T00:27:14.622Z","updated_at":"2025-06-29T06:33:00.080Z","avatar_url":"https://github.com/DrPsychick.png","language":"Shell","funding_links":["https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=FTXDN7LCDWUEA\u0026source=url","https://github.com/sponsors/DrPsychick"],"categories":[],"sub_categories":[],"readme":"# [Docker image: drpsychick/telegraf](https://hub.docker.com/r/drpsychick/telegraf/)\n\n[![Docker image](https://img.shields.io/docker/image-size/drpsychick/telegraf?sort=date)](https://hub.docker.com/r/drpsychick/telegraf/tags)\n[![CircleCI](https://img.shields.io/circleci/build/github/DrPsychick/docker-telegraf)](https://app.circleci.com/pipelines/github/DrPsychick/docker-telegraf)\n[![DockerHub pulls](https://img.shields.io/docker/pulls/drpsychick/telegraf.svg)](https://hub.docker.com/r/drpsychick/telegraf/)\n[![GitHub stars](https://img.shields.io/github/stars/drpsychick/docker-telegraf.svg)](https://github.com/drpsychick/docker-telegraf)\n[![DockerHub stars](https://img.shields.io/docker/stars/drpsychick/telegraf.svg)](https://hub.docker.com/r/drpsychick/telegraf/)\n[![Contributors](https://img.shields.io/github/contributors/drpsychick/docker-telegraf.svg)](https://github.com/drpsychick/docker-telegraf/graphs/contributors)\n[![Paypal](https://img.shields.io/badge/donate-paypal-00457c.svg?logo=paypal)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick\u0026hosted_button_id=FTXDN7LCDWUEA\u0026source=url)\n[![GitHub Sponsor](https://img.shields.io/badge/github-sponsor-blue?logo=github)](https://github.com/sponsors/DrPsychick)\n\n[![GitHub last commit (branch)](https://img.shields.io/github/last-commit/drpsychick/docker-telegraf/master.svg)](https://github.com/drpsychick/docker-telegraf)\n[![license](https://img.shields.io/github/license/drpsychick/docker-telegraf.svg)](https://github.com/drpsychick/docker-telegraf/blob/master/LICENSE)\n[![GitHub issues](https://img.shields.io/github/issues/drpsychick/docker-telegraf.svg)](https://github.com/drpsychick/docker-telegraf/issues)\n[![GitHub closed issues](https://img.shields.io/github/issues-closed/drpsychick/docker-telegraf.svg)](https://github.com/drpsychick/docker-telegraf/issues?q=is%3Aissue+is%3Aclosed)\n[![GitHub pull requests](https://img.shields.io/github/issues-pr/drpsychick/docker-telegraf.svg)](https://github.com/drpsychick/docker-telegraf/pulls)\n[![GitHub closed pull requests](https://img.shields.io/github/issues-pr-closed/drpsychick/docker-telegraf.svg)](https://github.com/drpsychick/docker-telegraf/pulls?q=is%3Apr+is%3Aclosed)\n\n\nbased on telegraf:alpine docker image\n\n## Purpose\n* make it fully configurable through environment variables\n* use one image to run them all\n* run stateless, environment configured containers (see https://12factor.net/)\n\n## Usage\n\n### **UPDATE 2021-04-28**\n**BC Breaking Change** in the environments:\n\nThe image is now using a small go utility (`toml_update`) to read, modify and write a valid `toml` configuration file.\n```shell\n# before\nconf_templates=\"telegraf.conf.tmpl:/etc/telegraf/telegraf.conf\"\nconf_var_prefix=TEL_\nconf_vars_telegrafconf=${conf_vars_telegrafconf:-'TEL_GLOBAL_TAGS TEL_AGENT TEL_OUTPUTS TEL_PROCESSORS TEL_AGGREGATORS TEL_INPUTS'}\nTEL_AGENT_HOSTNAME=hostname = \"myhostname\"\nTEL_OUTPUTS_INFLUXDB_URLS=urls = [\"http://yourinfluxhost:8086\"]\nTEL_INPUTS_CPU_FLAGS = \"percpu = true\\ntotalcpu = true\"\n# after\nCONF_UPDATE=/etc/telegraf/telegraf.con\nCONF_PREFIX=TEL\nTEL_AGENT_NAMEDOESNOTMATTER=agent.hostname=myhostname\nTEL_REALLYDOESNOTMATTER=outputs.influxdb.urls=[\"https://yourinfluxhost:8086\"]\nTEL_CPUFLAG1=inputs.cpu.percpu=true\nTEL_CPUFLAG2=inputs.cpu.totalcpu=true\n```\n\nTry it in 3 steps\n\n### 1 create your own telegraf.env\n```\ndocker run --rm -it drpsychick/telegraf:latest cat /default.env \u003e telegraf.env\n```\n\n### 2 configure it\nEdit at least your hostname and output (influxdb or sth. else) in `telegraf.env`:\n```\nTLG_AGENT_HOSTNAME=agent.hostname=\"myhostname\"\nTLG_INFLUXDB_URL=outputs.influxdb.urls=[\"http://yourinfluxhost:8086\"]\n```\n\nYou can add as many variables as you want for more inputs and their configuration, there are only a few rules:\n1. the variable must start with a known prefix (the `CONF_PREFIX` variable in `default.env`) \n2. the value must be a single row - due to Docker environment variables restrictions\n3. use one variable for each setting \n\nFor more examples see `default.env`\n```\nTLG_INPUTS_CPU_PERCPU=inputs.cpu.percpu=true\nTLG_INPUTS_CPU_TOTAL=inputs.cpu.totalcpu=true\nTLG_INPUTS_CPU_TIME=inputs.cpu.collect_cpu_time=false\nTLG_INPUTS_CPU_ACTIVE=inputs.cpu.report_active=false\n```\nThe `toml_update` tool will take the configured prefixes in order and update the configuration file from all matching variables one-by-one.\n\n### 3 test and run it\nRun in a separate teminal\n```\ndocker run --rm -it --cap-add NET_ADMIN --env-file telegraf.env --name telegraf-1 drpsychick/telegraf:latest telegraf --test\ndocker run --rm -it --cap-add NET_ADMIN --env-file telegraf.env --name telegraf-1 drpsychick/telegraf:latest\n```\n\nCheck your influxdb for new input\n\n## Configure it to your needs\nYou can use any `TLG_` variable in your `telegraf.env`. They will be added to the config during container startup.\n\n### Example \n```\nTLG_INPUTS_DISK_FLAGS=inputs.disk.ignore_fs=[\"tmpfs\", \"devtmpfs\", \"devfs\"]\n```\n\n## Run as `root`\nSome plugins require root privileges to work, for example `smart` \n(see this article: https://medium.com/opsops/why-smartctl-could-not-be-run-without-root-7ea0583b1323).\nYou can simply start the container with user root.\n\n```shell\ndocker run --user root [...] --name telegraf-root drpsychick/telegraf:latest\n```\n\n\n**Beware**:\n\nDocker only support *simple variables*. No \", no ' and especially no newlines in variables.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrpsychick%2Fdocker-telegraf","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrpsychick%2Fdocker-telegraf","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrpsychick%2Fdocker-telegraf/lists"}