topbeat

A module to install and manage topbeat
pcfens

pcfens

pcfens

42,618 downloads

42,618 latest version

4.6 quality score

Version information

  • 0.1.0 (latest)
released Jul 3rd 2019
This version is compatible with:
  • RedHat
    ,
    Ubuntu
    ,
    CentOS
    ,
    Fedora
    ,
    OracleLinux
    ,
    Scientific
    ,
    Windows

Start using this module

Documentation

pcfens/topbeat — version 0.1.0 Jul 3rd 2019

puppet-topbeat

Build Status

Table of Contents

  1. Description
  2. Setup - The basics of getting started with topbeat
  3. Usage - Configuration options and additional functionality
  4. Reference
  5. Limitations - OS compatibility, etc.
  6. Development - Guide for contributing to the module

Description

The topbeat module installs and configures topbeat to ship system performance information to elasticsearch, logstash, or anything else that accepts the beats protocol.

Setup

What topbeat affects

By default topbeat adds a software repository to your system, and installs topbeat along with required configurations.

Setup Requirements

The topbeat module depends on puppetlabs/stdlib, and on puppetlabs/apt on Debian based systems.

Beginning with topbeat

topbeat can be installed with puppet module install pcfens-topbeat (or with r10k, librarian-puppet, etc.)

By default, topbeat ships system statistics (system load, cpu usage, swap usage, and memory usage), per-process statistics, and disk mounts/usage.

Usage

All of the default values in topbeat follow the upstream defaults (at the time of writing).

To ship system stats to elasticsearch:

class { 'topbeat':
  output => {
    'elasticsearch' => {
     'hosts' => [
       'http://localhost:9200',
       'http://anotherserver:9200'
     ],
     'index'       => 'topbeat',
     'cas'         => [
        '/etc/pki/root/ca.pem',
     ],
    },
  },
}

To ship system stats through logstash:

class { 'topbeat':
  output => {
    'logstash'     => {
     'hosts' => [
       'localhost:5044',
       'anotherserver:5044'
     ],
     'loadbalance' => true,
    },
  },
}

Shipper and logging options can be configured the same way, and are documented on the elastic website.

Configuring Inputs

By default, topbeat ships everything that it can, but can be tuned to ship specific information.

The full default hash looks like

{
  period => 10,   # How often stats should be collected and sent, in seconds.
  procs  => [     # An array of what processes to send more detailed information on.
    '.*',
  ]
  stats  => {
    system     => true,   # Whether or not to ship system-wide information
    proc       => true,   # Whether or not individual process information should be shipped
    filesystem => true,   # Whether or not filesystem/disk information should be shipped
  }
}

Each component is documented more fully in the topbeat documentation.

Reference

Public Classes

Class: topbeat

Installs and configures topbeat.

Parameters within topbeat

  • package_ensure: [String] The ensure parameter for the topbeat package (default: present)
  • manage_repo: [Boolean] Whether or not the upstream (elastic) repo should be configured or not (default: true)
  • service_ensure: [String] The ensure parameter on the topbeat service (default: running)
  • service_enable: [String] The enable parameter on the topbeat service (default: true)
  • config_file_mode: [String] The permissions mode set on configuration files (default: 0644)
  • input: [Hash] Will be converted to YAML for the input section of the configuration file (see documentation, and above)(default: {})
  • output: [Hash] Will be converted to YAML for the required output section of the configuration (see documentation, and above)
  • shipper: [Hash] Will be converted to YAML to create the optional shipper section of the topbeat config (see documentation)
  • logging: [Hash] Will be converted to YAML to create the optional logging section of the topbeat config (see documentation)
  • conf_template: [String] The configuration template to use to generate the main topbeat.yml config file
  • download_url: [String] The URL of the zip file that should be downloaded to install topbeat (windows only)
  • install_dir: [String] Where topbeat should be installed (windows only)
  • tmp_dir: [String] Where topbeat should be temporarily downloaded to so it can be installed (windows only)
  • prospectors: [Hash] Prospectors that will be created. Commonly used to create prospectors using hiera

Private Classes

Class: topbeat::config

Creates the configuration files required for topbeat (but not the prospectors)

Class: topbeat::install

Calls the correct installer class based on the kernel fact.

Class: topbeat::params

Sets default parameters for topbeat based on the OS and other facts.

Class: topbeat::repo

Installs the yum or apt repository for the system package manager to install topbeat.

Class: topbeat::service

Configures and manages the topbeat service.

Class: topbeat::install::linux

Install the topbeat package on Linux kernels.

Class: topbeat::install::windows

Downloads, extracts, and installs the topbeat zip file in Windows.

Limitations

This module doesn't load the elasticsearch index template into elasticsearch (required when shipping directly to elasticsearch).

Development

Pull requests and bug reports are welcome. If you're sending a pull request, please consider writing tests if applicable.