telegraf
Version information
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
Add this module to your Puppetfile:
mod 'rplessl-telegraf', '0.13.2'
Learn more about managing modules with a PuppetfileDocumentation
Overview
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
- Overview
- Module Description - What the module does and why it is useful
- Setup - The basics of getting started with telegraf
- Development - Guide for contributing to the module
- Testing - Guide to test the module
- 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.
-
OpenTSDB
class { '::telegraf::plugins::outputs::opentsdb': opentsdb_server => 'my.opentsdb.server.domain.com', opentsdb_port => 4242, opentsdb_prefix => 'my.metrics.telegraf.', }
-
MySQL
include '::telegraf::plugins::inputs::mysql'
-
PostgreSQL
include '::telegraf::plugins::inputs::postgresql'
-
PuppetAgent
include '::telegraf::plugins::inputs::puppetagent'
-
Elasticsearch
class { '::telegraf::plugins::inputs::elasticsearch': }
-
Procstats
class { '::telegraf::plugins::inputs::procstats': }
-
PowerDNS
class { '::telegraf::plugins::inputs::powerdns': }
Development
- Fork it (https://github.com/rplessl/puppet-telegraf/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - 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
v0.13.2 [2016-06-21]
- fixing plugin inclusion -- @rplessl
- fixing linter errors -- @rplessl
v0.13.1 [2016-06-20]
- Enhanced for working with telegraf 0.13.x -- @thirdeyenick and @rplessl
- Refactoring plugin system (closes #23) -- @rplessl
- enhance plugin system to be more consitent with telegraf itself (closes #23)
- Documenation love (closes #24) -- @rplessl
- Added apt / yum repository handling (closes #14) -- @rplessl
- simplify acceptance tests
- reduce and reenhance Gemfile to build with ruby 2.3 and puppet 3.8 / 4.0
v0.2.4 [2015-12-25]
- Enhanced documention for using pulgins (Closes #16, #17) -- @rplessl
- Enhanced for puppet 4 compatiblity (closes #15) -- @rplessl
- Changed puppet module to parameterization -- Thanks @ntent-ashton!
- Added Elasticsearch plugin -- Thanks @ntent-ashton!
- Added parametrization for CPU / Mountpoints -- Thanks @ntent-ashton!
- New Upstream Release and Interface for InfluxData Telegraf 0.2.4 -- @rplessl
- Restart Telegraf Service if output plugin configuration changes -- @rplessl
- Added configurable Output-Plugins for
- OpenTSDB -- @rplessl
- Added configurable Input-Plugins for
- Mysql -- @rplessl
- PostgreSQL -- @rplessl
- PuppetAgent -- @rplessl
v0.2.0 [2015-11-09]
- Updated installation manual in README.md -- @rplessl
- Fix last bits of code coverage -- @rplessl
- Ready to add plugins for comming releases (v0.2.1++) -- @rplessl
v0.1.91 [2015-11-09]
- More Rake Tasks -- @rplessl
- More Code Coverage -- @rplessl
v0.1.90 [2015-11-03]
- New Upstream Release and Interface for InfluxDB Telegraf 0.2.0 -- @rplessl
- Snipplets Mechanism with /etc/opt/telegraf/telegraf.d -- @rplessl
v0.0.1 [2015-10-01]
- Initial release -- @rplessl
Dependencies
- puppetlabs-stdlib (>=3.2.0 <5.0.0)
- puppetlabs-apt (>= 2.0.0 <3.0.0)
- maestrodev/wget (>= 1.6.0 <2.0.0)
The MIT License (MIT) Copyright (c) 2015-2016 Roman Plessl, Nine Internet Solutions AG and Copyright (c) 2015-2016 Roman Plessl, Plessl + Burkhardt GmbH Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.