GithubHelp home page GithubHelp logo

puppet-telegraf's Introduction

Puppet module for InfluxData's Telegraf

Telegraf (https://github.com/influxdata/telegraf) is a universal monitoring agent from InfluxData, which can forward metrics to many different systems and collect stats from many different things on your system using plugins. This puppet module supports the plugins which I personally use.

manifests/package.pp is derived from https://github.com/rplessl/puppet-telegraf

Sample profile using this module:

# == Class: profile::telegraf
#
# telegraf and plugins:
#
class profile::telegraf(
  $agent_flush_interval       = hiera('telegraf::agent_flush_interval', '60s'),
  $agent_hostname             = hiera('telegraf::agent_hostname', $::hostname),
  $agent_interval             = hiera('telegraf::agent_interval', '60s'),
  $ensure                     = hiera('telegraf::ensure', 'latest'),
  $install_from_repository    = hiera('telegraf::install_from_repository', true),
  $outputs_influxdb_urls      = hiera('telegraf::outputs_influxdb_urls', ['http://localhost:8086']),
  $outputs_influxdb_database  = hiera('telegraf::outputs_influxdb_database', 'telegraf'),
  $outputs_influxdb_username  = hiera('telegraf::outputs_influxdb_username', 'telegraf'),
  $outputs_influxdb_password  = hiera('telegraf::outputs_influxdb_password', 'metricsmetricsmetricsmetrics'),
  $enable_statsd_interface    = hiera('profile::telegraf::enable_statsd_interface', true),
  $statsd_service_address     = hiera('profile::telegraf::statsd_service_address', 'localhost:8125'),
  $tag_az                     = hiera('profile::telegraf::tag_az', $::ec2_placement_availability_zone),
  $tag_environment            = hiera('profile::telegraf::tag_environment', $::stage),
  $tag_region                 = hiera('profile::telegraf::tag_region', $::ec2_region),
  $tag_role                   = hiera('profile::telegraf::tag_role', $::role),
) {

  # Install the base telegraf service:
  class { '::telegraf':
    ensure                    => $ensure,
    install_from_repository   => $install_from_repository,
    tags                      => {
      az                      => $tag_az,
      environment             => $tag_environment,
      hostname                => $tag_hostname,
      region                  => $tag_region,
      role                    => $tag_role,
    },
    agent_flush_interval      => $agent_flush_interval,
    agent_hostname            => $agent_hostname,
    agent_interval            => $agent_interval,
  }

  # The InfluxDB output plugin:
  class { '::telegraf::outputs::influxdb':
    urls                      => $outputs_influxdb_urls,
    database                  => $outputs_influxdb_database,
    username                  => $outputs_influxdb_username,
    password                  => $outputs_influxdb_password,
  }

  # Monitor CPU utilisation:
  class { '::telegraf::inputs::cpu':
    drop                      => ['time_*'],
  }

  # Monitor filesystems:
  class { '::telegraf::inputs::disk': }

  # Monitor storage devices:
  class { '::telegraf::inputs::diskio': }

  # Monitor memory utilisation:
  class { '::telegraf::inputs::mem': }

  # Monitor network interfaces:
  class { '::telegraf::inputs::net':
    pass                      => ['bytes_*', 'drop_*', 'err_*'],
  }

  # Run a local StatsD interface:
  class { '::telegraf::inputs::statsd':
    interval                  => '120s',
    delete_counters           => true,
    delete_gauges             => true,
    delete_sets               => true,
    delete_timings            => true,
    percentiles               => [95],
    service_address           => $statsd_service_address,
  }

  # Monitor swap utilisation:
  class { '::telegraf::inputs::swap':
    ensure                    => 'absent',
  }

  # Monitor system utilisation (load averages etc):
  class { '::telegraf::inputs::system': }

}

Supported plugins

Input

  • cpu
  • disk
  • diskio
  • elasticsearch
  • mem
  • net
  • nsq
  • puppetagent
  • statsd
  • swap
  • system
  • tcp_listener
  • udp_listener
  • zookeeper

Output

  • influxdb
  • librato
  • prometheus

puppet-telegraf's People

Contributors

chrusty avatar codec avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.