Forge Home

telegraf

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

10,867 downloads

7,959 latest version

5.0 quality score

We run a couple of automated
scans to help you access a
module's quality. Each module is
given a score based on how well
the author has formatted their
code and documentation and
modules are also checked for
malware using VirusTotal.

Please note, the information below
is for guidance only and neither of
these methods should be considered
an endorsement by Puppet.

Support the Puppet Community by contributing to this module

You are welcome to contribute to this module by suggesting new features, currency updates, or fixes. Every contribution is valuable to help ensure that the module remains compatible with the latest Puppet versions and continues to meet community needs. Complete the following steps:

  1. Review the module’s contribution guidelines and any licenses. Ensure that your planned contribution aligns with the author’s standards and any legal requirements.
  2. Fork the repository on GitHub, make changes on a branch of your fork, and submit a pull request. The pull request must clearly document your proposed change.

For questions about updating the module, contact the module’s author.

Version information

  • 0.13.2 (latest)
  • 0.13.1 (deleted)
  • 0.2.4
  • 0.2.0
released Jun 21st 2016
This version is compatible with:
  • Puppet Enterprise 2023.8.x, 2023.7.x, 2023.6.x, 2023.5.x, 2023.4.x, 2023.3.x, 2023.2.x, 2023.1.x, 2023.0.x, 2021.7.x, 2021.6.x, 2021.5.x, 2021.4.x, 2021.3.x, 2021.2.x, 2021.1.x, 2021.0.x, 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
  • , , ,

Start using this module

  • r10k or Code Manager
  • Bolt
  • Manual installation
  • Direct download

Add this module to your Puppetfile:

mod 'rplessl-telegraf', '0.13.2'
Learn more about managing modules with a Puppetfile

Add this module to your Bolt project:

bolt module add rplessl-telegraf
Learn more about using this module with an existing project

Manually install this module globally with Puppet module tool:

puppet module install rplessl-telegraf --version 0.13.2

Direct download is not typically how you would use a Puppet module to manage your infrastructure, but you may want to download the module in order to inspect the code.

Download

Documentation

rplessl/telegraf — version 0.13.2 Jun 21st 2016

Overview

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

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     => ['http://influxdb-01.mydomain.com:8086', 'http://influxdb-02.mydomain.com:8086'],
    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"],
}

Plugins

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

  1. OpenTSDB

    class { '::telegraf::plugins::outputs::opentsdb':
      opentsdb_server => 'my.opentsdb.server.domain.com',
      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': }
    

Development

  1. Fork it (https://github.com/rplessl/puppet-telegraf/fork)
  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

Testing Code Enhancement (rspec)

Testing is done with rspec.

Testing Setup with Vagrant

Install and setup vagrant [https://docs.vagrantup.com/v2/installation/index.html](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

License

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

See LICENSE File