This Puppet module installs and manages InfluxDB Telegraf.
Use this puppet module to install and configure InfluxDB Telegraf with version 0.2.4 and newer.
- 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
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).
The installed package for telegraf will be fetched from a) the provided package from get.influxdb.com or b) the provided package from your own repository (apt repository, aptly, yum)
Remark: The apt / yum repository from InfluxData will be included in version 0.3.0 of this module.
puppet-telegraf requires only the wget module when the parameter install_from_repository
is set to false. Furthermore the stdlib
module is required.
Include the class and set the necessary Telegraf and InfluxDB parameters.
class { '::telegraf':
version => '0.2.4',
install_from_repository => false,
config_template => 'telegraf/telegraf.conf.erb',
# [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',
}
This puppet-telegraf module supports the following configuration options:
class { '::telegraf':
ensure => 'installed',
version => '0.2.4',
install_from_repository => false,
config_template => 'telegraf/telegraf.conf.erb',
config_base_file => '/etc/opt/telegraf/telegraf.conf',
config_directory => '/etc/opt/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.
- OpenTSDB
class { '::telegraf::plugins::opentsdb':
opentsdb_server => 'my.opentsdb.server.domain.com',
opentsdb_port => 4242,
opentsdb_prefix => 'my.metrics.telegraf.',
}
- MySQL
include '::telegraf::plugins::mysql'
- PostgreSQL
include '::telegraf::plugins::postgresql'
- PuppetAgent
include '::telegraf::plugins::puppetagent'
- Elasticsearch
class { '::telegraf::plugins::elasticsearch': }
- 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 is done with rspec.
Install and setup vagrant [https://docs.vagrantup.com/v2/installation/index.html](as described here).
Fetch virtual machines:
vagrant box add puppetlabs/ubuntu-14.04-64-puppet --insecure
vagrant box add puppetlabs/centos-6.6-64-puppet --insecure
vagrant box add puppetlabs/centos-7.0-64-puppet --insecure
vagrant box add puppetlabs/debian-7.8-64-puppet --insecure
vagrant box add markusperl/debian-8.0-jessie-64-shrinked-puppet --insecure
Add vagrant puppet support and run tests:
bundle install
bundle exec librarian-puppet install
vagrant up
Licensed under the MIT License. Copyright 2015 Roman Plessl (@rplessl)
See LICENSE File