metricbeat
Version information
This version is compatible with:
- Puppet Enterprise 2018.1.x, 2017.3.x, 2017.2.x, 2017.1.x, 2016.5.x, 2016.4.x
- Puppet >= 4.7.0 < 6.0.0
- , , , , , , ,
Start using this module
Add this module to your Puppetfile:
mod 'roshan-metricbeat', '5.6.6'
Learn more about managing modules with a PuppetfileDocumentation
metricbeat
Table of Contents
- Description
- Setup - The basics of getting started with metricbeat
- Usage - Configuration options and additional functionality
- Reference - An under-the-hood peek at what the module is doing and how
- Limitations - OS compatibility, etc.
- Development - Guide for contributing to the module
Description
The metricbeat
installs the metricbeat operating system and service collector maintained by elastic.
Setup
What metricbeat affects
By default metricbeat
adds a software repository to your system and installs metricbeat
along with required configurations.
Beginning with metricbeat
Full metricbeat
functionality cam be configured with the modules
and outputs
parameters
declared. This module can run but the metricbeat agent on the nodes may not start their
services without these parameters defined.
class{'metricbeat':
modules => [
{
'module' => 'system',
'metricsets' => [
'cpu',
'load',
'memory',
'process',
],
'processes' => ['.*'],
},
],
outputs => {
'elasticsearch' => {
'hosts' => ['http://localhost:9200'],
'index' => 'metricbeat',
},
},
}
Usage
As of this writing all the default values follow the upstream values. This module saves all configuration
options in a to_yaml()
fashion. Therefore this allows some advanced configuration settings to be easily
rendered.
To ship metrics from an Apache Web Server to Elasticsearch
class{'metricbeat':
modules => [
{
'module' => 'apache',
'metricsets' => ['status'],
'hosts' => ['http://localhost'],
},
],
outputs => {
'elasticsearch' => {
'hosts' => ['http://localhost:9200'],
},
},
}
To ship metrics from a MySQL Database Server to Logstash
class{'metricbeat':
modules => {
'module' => 'mysql',
'metricsets' => ['status'],
'hosts' => ['tcp(127.0.0.1:3306)/']
'username' => 'root',
'password' => 'secret',
},
outputs => {
'logstash' => {
'hosts' => ['localhost:5044'],
},
},
}
Please review the elastic documentation for configuration options and service compatability.
Processors
Libbeat 5.0 and later include a feature for filtering/enhancing exported data
called processors.
These may be added into the configuration by populating the processors
parameter
and may apply to all events or those that match certain conditions.
To drop events when field apache.status.total_accesses
is 0
class{'metricbeat':
processors => [
{
'drop_event' => {
'when' => {
'apache.status.total_accesses' => 0,
}
}
}
],
...
}
To drop the mysql.status.aborted.clients
field from the output
class{'metricbeat':
processors => [
{
'drop_field' => {
'fields' => 'mysql.status.aborted.clients',
}
}
]
}
Please review the documentation
Reference
Public Classes
Class: metricbeat
Installs and configures metricbeat.
Parameters within metricbeat
modules
: [Tuple[Hash]] The required metricbeat.modules section of the configuration.outputs
: [Hash] The required output section of the configuration.beat_name
: [String] The name of the beat shipper (default: hostname)ensure
: [String] Valid values are 'present' and 'absent'. Determines weather to manage all required resources or remove them from the node. (default: 'present')disable_config_test
: [Boolean] If true, disable configuration file testing. It is generally recommended to leave this parameter at this default value. (default: false)fields
: [Hash] Optional fields to add any additional information to the output. (default: undef)fields_under_root
: [Boolean] By default custom fields are under afields
sub-dictionary. When set to true custom fields are added to the root-level document. (default: false)logging
: [Hash] Defines metricbeat's logging configuration, if not explicitly configured all logging output is forwarded to syslog on Linux nodes and file output on Windows. See the docs for all available options.manage_repo
: [Boolean] When false does not install the upstream repository to the node's package manager. (default: true)package_ensure
: [String] The desired state of the Package resources. Only applicable ifensure
is 'present'. (default: 'present')processors
: [Array[Hash]] Add processors to the configuration to run on data before sending to the output. (default: undef)queue_size
: [Integer] The queue size for single events in the processing pipeline. (default: 1000)service_ensure
: [String] Determine the state of the metricbeat service. Must be one of 'enabled', 'disabled', 'running', 'unmanaged'. (default: enabled)service_has_restart
: [Boolean] When true the Service resource issues the 'restart' command instead of 'stop' and 'start'. (default: true)tags
: [Array] Optional list of tags to help group different logical properties easily. (default: undef)
Private Classes
Class: metricbeat::config
Manages metricbeats main configuration file.
Class: metricbeat::install
Installs the metricbeat package.
Class: metricbeat::repo
Installs the upstream Yum or Apt repository for the system package manager.
Class: metricbeat::service
Manages the metricbeat service.
Limitations
This module does not support loading kibana dashboards or elasticsearch templates, used when outputting to Elasticsearch.
Development
Pull requests and bug reports are welcome. If you're sending a pull request, please consider writing tests if applicable.
Testing
Sandbox testing is done through the PDK utility provided by
Puppet. To utilize PDK
execute the following commands to validate and
test the new code:
- Validate syntax of
metadata.json
, all*.pp*
and all*.rb
files
pdk validate
- Perform tests
pdk test unit
Changelog
All notable changes to this project will be documented in this file.
Release 0.1.0
- Initial release, please review module and metricbeat documentation for configuration options.
Features
Bugfixes
Known Issues
Dependencies
- puppetlabs-stdlib (>= 4.13.0 < 5.0.0)
- puppetlabs-apt (>= 4.0.0 < 5.0.0)
- darin-zypprepo (>= 1.0.0 < 2.0.0)