setup, manage and configures InfluxData's Telegraf 0.13.1 and newer

Roman Plessl



6,711 latest version

5.0 quality score

Version information

  • 0.13.2 (latest)
  • 0.13.1
  • 0.2.4
  • 0.2.0
released Jun 21st 2016
This version is compatible with:
  • Puppet Enterprise 2019.8.x, 2019.7.x, 2019.5.x, 2019.4.x, 2019.3.x, 2019.2.x, 2019.1.x, 2019.0.x, 2018.1.x, 2017.3.x, 2017.2.x, 2017.1.x, 2016.5.x, 2016.4.x
  • Puppet >= 3.8.0
  • Debian

Start using this module


rplessl/telegraf — version 0.13.2 Jun 21st 2016


Build Status rplessl-telegraf

This puppet module installs and manages the configuration of InfluxData's Telegraf. A metrics collection agent.

Use this puppet module with Telegraf version 0.13.1 and newer.

This puppet module was designed and tested with Puppet 3.8.

Table of Contents

  1. Overview
  2. Module Description - What the module does and why it is useful
  3. Setup - The basics of getting started with telegraf
  4. Development - Guide for contributing to the module
  5. Testing - Guide to test the module
  6. License

Module Description

The module installs the telegraf package from the provided repositories and installs the basic configuration file and reconfigures this setup based on your whishes.

Supported Linux distributions are Debian based (Ubuntu, Debian) and RedHat based (CentOS, RHEL).

Tests have also be run on an raspberry pi 2 with raspbian (jessie).


Setup Requirements

puppet-telegraf requires these third party puppet modules

  • puppet-stdlibs
  • wget module when the parameter download_package is set to true.
  • apt module when the parameter manage_repo is set to true on Debian or Ubuntu.

Beginning with telegraf

Include the class and set the necessary Telegraf and InfluxDB parameters.

class { '::telegraf':
    version                   => '0.13.1',
    manage_repo               => true,
    config_template           => 'telegraf/telegraf.conf.erb',
    # [[outputs.influxdb]] section of telegraf.conf
    outputs_influxdb_enabled  => true,
    outputs_influxdb_urls     => ['', ''],
    outputs_influxdb_database => 'telegraf',
    outputs_influxdb_username => 'telegraf',
    outputs_influxdb_password => 'metricsmetricsmetricsmetrics',

This puppet-telegraf module supports the following configuration options:

class { '::telegraf':
    ensure                    => 'installed',
    version                   => '0.13.1',
    download_package          => false,
    manage_repo               => false,
    config_template           => 'telegraf/telegraf.conf.erb',
    config_base_file          => '/etc/telegraf/telegraf.conf',
    config_directory          => '/etc/telegraf/telegraf.d',

    # [[outputs.influxdb]] section of telegraf.conf
    outputs_influxdb_enabled  => true,
    outputs_influxdb_urls     => ['http://localhost:8086'],
    outputs_influxdb_database => 'telegraf',
    outputs_influxdb_username => 'telegraf',
    outputs_influxdb_password => 'metricsmetricsmetricsmetrics',

    # [tags] section of telegraf.conf
    tags                      => {
      virtual            => $::virtual,
      lsbdistdescription => $::lsbdistdescription,
      environment        => $::my_own_facter_environment,
      location           => $::my_own_facter_location,

    # [agent]
    agent_hostname            => $::hostname,
    agent_interval            => '10s',

    # [[plugins.cpu]]
    cpu_percpu                => true,
    cpu_totalcpu              => true,
    cpu_drop                  => ["cpu_time"],

    # [[plugins.disk]]
    disk_mountpoints          => ["/","/home"],


The following plugins have been prepared for input / output configuration of Telegraf.

  1. OpenTSDB

    class { '::telegraf::plugins::outputs::opentsdb':
      opentsdb_server => '',
      opentsdb_port   => 4242,
      opentsdb_prefix => 'my.metrics.telegraf.',
  2. MySQL

    include '::telegraf::plugins::inputs::mysql'
  3. PostgreSQL

    include '::telegraf::plugins::inputs::postgresql'
  4. PuppetAgent

    include '::telegraf::plugins::inputs::puppetagent'
  5. Elasticsearch

    class { '::telegraf::plugins::inputs::elasticsearch': }
  6. Procstats

    class { '::telegraf::plugins::inputs::procstats': }
  7. PowerDNS

    class { '::telegraf::plugins::inputs::powerdns': }


  1. Fork it (
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Wish: Make sure your Pull Requests passes the Rspec tests.


Testing Code Enhancement (rspec)

Testing is done with rspec.

Testing Setup with Vagrant

Install and setup vagrant [](as described here).

Fetch virtual machines:

vagrant box add puppetlabs/ubuntu-16.04-64-puppet --insecure
vagrant box add puppetlabs/ubuntu-14.04-64-puppet --insecure
vagrant box add puppetlabs/debian-7.8-64-puppet   --insecure
vagrant box add puppetlabs/debian-8.2-64-puppet   --insecure
vagrant box add puppetlabs/centos-7.2-64-puppet   --insecure
vagrant box add puppetlabs/centos-6.6-64-puppet   --insecure

Add vagrant puppet support and run tests:

bundle install
bundle exec librarian-puppet install
vagrant up


Licensed under the MIT License.

Copyright (c) 2015-2016 Roman Plessl (@rplessl), Nine Internet Solutions AG and

Copyright (c) 2015-2016 Roman Plessl (@rplessl), Plessl + Burkhardt GmbH