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 >= 3.0.0 < 6.0.0
- , , , ,
Start using this module
Add this module to your Puppetfile:
mod 'liger1978-netdata', '0.2.0'
Learn more about managing modules with a PuppetfileDocumentation
netdata
Table of Contents
- Description
- Beginning with netdata
- 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
This module installs and configures netdata. It is currently designed to work only with RHEL/CentOS 7 and Ubuntu 18.04. For Red Hat systems, it uses the RPM package available in the harbottle-main repository.
The netdata module can do the following:
- Install a yum repo for netdata.
- Install the netdata package.
- Comprehensively manage the main netdata configuration files.
- Manage the netdata service.
Beginning with netdata
For an internet-connected server, this is the minimum required to install, configure and run netdata using the netdata package from the harbottle-main repository.
Using Puppet only:
class { 'netdata':
manage_yumrepo => true,
}
Using Puppet and Hiera:
include netdata
---
netdata::manage_yumrepo: true
Usage
Here is a comprehensive example using many of the available parameters to extensively modify module behaviour.
Using Puppet only:
class { 'netdata':
manage_yumrepo => true,
yumrepo => {
'local-netdata-repo' => {
baseurl => 'https://yum.local/local-netdata-repo',
descr => 'Local netdata repo',
enabled => true,
gpgcheck => false
}
},
manage_package => true,
package_name => 'my_netdata',
package_ensure => '1.10.0',
manage_cfg_dir => true,
cfg_dir => '/opt/netdata/etc',
manage_main_cfg => true,
main_cfg_file => '/opt/netdata/etc/netdata.conf',
main_cfg => {
'global' => {
'run as user' => 'my_netdata',
'history' => 3600,
'bind to' => '*'
},
'web' => {
'web files owner' => 'root',
'web files group' => 'my_netdata'
}
},
manage_apps_groups_cfg => true,
apps_groups_cfg_file => '/opt/netdata/etc/apps_groups.conf',
apps_groups_cfg => [
'netdata: netdata',
'apps.plugin: apps.plugin',
'freeipmi.plugin: freeipmi.plugin',
'charts.d.plugin: *charts.d.plugin*',
'node.d.plugin: *node.d.plugin*',
'python.d.plugin: *python.d.plugin*',
'tc-qos-helper: *tc-qos-helper.sh*',
'fping: fping',
'httpd: apache* httpd nginx* lighttpd',
'corporate: foo* bar* *bat*'
],
manage_charts_d_cfg => true,
charts_d_cfg_file => '/opt/netdata/etc/charts.d.conf',
charts_d_cfg => {
'time_divisor' => '100',
'opensips' => 'no'
},
manage_fping_cfg => true,
fping_cfg_file => '/opt/netdata/etc/fping.conf',
fping_bin => '/usr/local/bin/fping',
fping_hosts => [
'web.local',
'192.168.2.3'
],
fping_update_every => '4',
fping_ping_every => '400',
fping_opts => '-R -b 56 -i 1 -r 0 -t 5000',
manage_node_d_cfg => true,
node_d_cfg_file => '/opt/netdata/etc/node.d.conf',
node_d_cfg => {
'update_every' => 5,
'modules' => {
'named' => {
'enabled' => true
},
'sma_webbox' => {
'enabled' => true
},
'snmp' => {
'enabled' => false
}
}
},
manage_python_d_cfg => true,
python_d_cfg_file => '/opt/netdata/etc/python.d.conf',
python_d_cfg => {
'enabled' => 'no'
},
manage_stream_cfg => true,
stream_cfg_file => '/opt/netdata/etc/stream.conf',
stream_enabled => true,
stream_destination => 'upstream.local',
stream_api_key => 'my_sending_api_key',
stream_timeout => 120,
stream_default_port => 19998,
stream_buffer_size_bytes => 1048576,
stream_reconnect_delay => 10,
stream_initial_clock_resync => 30,
stream_options_per_id => {
'api_key_1' => {
'enabled' => 'no'
}
},
manage_service => true,
service_name => 'my_netdata',
ensure_service => 'running',
enable_service => false,
}
Using Puppet and Hiera:
include netdata
---
netdata::manage_yumrepo: true
netdata::yumrepo:
local-netdata-repo:
baseurl: https://yum.local/local-netdata-repo
descr: Local netdata repo
enabled: true
gpgcheck: false
netdata::manage_package: true
netdata::package_name: my_netdata
netdata::package_ensure: '1.10.0'
netdata::manage_cfg_dir: true
netdata::cfg_dir: /opt/netdata/etc
netdata::manage_main_cfg: true
netdata::main_cfg_file: /opt/netdata/etc/netdata.conf
netdata::main_cfg:
global:
run as user: my_netdata
history: 3600
bind to: '*'
web:
web files owner: root
web files group: my_netdata
netdata::manage_apps_groups_cfg: true
netdata::apps_groups_cfg_file: /opt/netdata/etc/apps_groups.conf
netdata::apps_groups_cfg:
- 'netdata: netdata'
- 'apps.plugin: apps.plugin'
- 'freeipmi.plugin: freeipmi.plugin'
- 'charts.d.plugin: *charts.d.plugin*'
- 'node.d.plugin: *node.d.plugin*'
- 'python.d.plugin: *python.d.plugin*'
- 'tc-qos-helper: *tc-qos-helper.sh*'
- 'fping: fping'
- 'httpd: apache* httpd nginx* lighttpd'
- 'corporate: foo* bar* *bat*'
netdata::manage_charts_d_cfg: true
netdata::charts_d_cfg_file: /opt/netdata/etc/charts.d.conf
netdata::charts_d_cfg:
time_divisor: '100'
opensips: 'no'
netdata::manage_fping_cfg: true
netdata::fping_cfg_file: /opt/netdata/etc/fping.conf
netdata::fping_bin: /usr/local/bin/fping
netdata::fping_hosts:
- web.local
- 192.168.2.3
netdata::fping_update_every: '4'
netdata::fping_ping_every: '400'
netdata::fping_opts: -R -b 56 -i 1 -r 0 -t 5000
netdata::manage_node_d_cfg: true
netdata::node_d_cfg_file: /opt/netdata/etc/node.d.conf
netdata::node_d_cfg:
update_every: 5
modules:
named:
enabled: true
sma_webbox:
enabled: true
snmp:
enabled: false
netdata::manage_python_d_cfg: true,
netdata::python_d_cfg_file: /opt/netdata/etc/python.d.conf
netdata::python_d_cfg:
enabled: 'no'
netdata::manage_stream_cfg: true
netdata::stream_cfg_file: /opt/netdata/etc/stream.conf
netdata::stream_enabled: true
netdata::stream_destination: updstream.local
netdata::stream_api_key: my_sending_api_key
netdata::stream_timeout: 120
netdata::stream_default_port: 19998
netdata::stream_buffer_size_bytes: 1048576
netdata::stream_reconnect_delay: 10
netdata::stream_initial_clock_resync: 30
netdata::stream_options_per_id:
api_key_1:
enabled: 'no'
netdata::manage_service: true
netdata::service_name: my_netdata
netdata::ensure_service: running
netdata::enable_service: false
Reference
Reference documentation is generated using Puppet Strings.
If you are reading this at the Puppet Forge, you should find what you are looking for under the Reference
tab for this module, otherwise look for REFERENCE.md
in the same directory as this file.
Limitations
This module has been tested with Puppet 3, 4 and 5.
This module has been tested on:
- Red Hat Enterprise Linux 7
- CentOS 7
- Oracle Linux 7
- Scientific Linux 7
- Ubuntu 18.04
Development
Please open an issue, indicate you intend to work on it and create a GitLab merge request.
Reference
Classes
Public Classes
netdata
: Installs and configures netdata on your system.
Private Classes
netdata::config
: Private class for managing netdata configuration.netdata::install
: Private class for installing netdata packages.netdata::params
: Private class providing default values for netdata parameters.netdata::repo
: Private class for managing the netdata package repository.netdata::service
: Private class for managing the netdata service.
Classes
netdata
Installs and configures netdata on your system.
When this class is declared with the default options, Puppet:
- Installs the appropriate netdata software package for your operating system.
- Places the required configuration files in a directory, with the default location determined by your operating system.
- Starts and the enables the netdata service.
Examples
Basic usage
class { 'netdata': }
Parameters
The following parameters are available in the netdata
class.
manage_yumrepo
Data type: boolean
Whether the netdata package repository is managed (Red Hat OS family only).
Default value: $netdata::params::manage_yumrepo
yumrepo
Data type: hash
A hash of netdata package repository yumrepo
resources to create (Red Hat OS family only).
Default value: $netdata::params::yumrepo
manage_package
Data type: boolean
Whether the netdata package is managed.
Default value: $netdata::params::manage_package
package_name
Data type: string
The name of the netdata package.
Default value: $netdata::params::package_name
package_ensure
Data type: string
What state the netdata package should be in.
Default value: $netdata::params::package_ensure
manage_cfg_dir
Data type: boolean
Whether the netdata configuration directory is managed.
Default value: $netdata::params::manage_cfg_dir
cfg_dir
Data type: string
The path to the netdata configuration directory.
Default value: $netdata::params::cfg_dir
manage_main_cfg
Data type: boolean
Whether the netdata main configuration file is managed.
Default value: $netdata::params::manage_main_cfg
main_cfg_file
Data type: string
The path to the netdata main configuration file.
Default value: $netdata::params::main_cfg_file
main_cfg
Data type: hash
A hash of netdata main configuration settings.
Default value: $netdata::params::main_cfg
manage_apps_groups_cfg
Data type: boolean
Whether the netdata apps.plugin process grouping configuration file is managed.
Default value: $netdata::params::manage_apps_groups_cfg
apps_groups_cfg_file
Data type: string
The path to the netdata apps.plugin process grouping configuration file.
Default value: $netdata::params::apps_groups_cfg_file
apps_groups_cfg
Data type: hash
A hash of netdata apps.plugin process grouping configuration settings.
Default value: $netdata::params::apps_groups_cfg
manage_charts_d_cfg
Data type: boolean
Whether the netdata charts.d.plugin configuration file is managed.
Default value: $netdata::params::manage_charts_d_cfg
charts_d_cfg_file
Data type: string
The path to the netdata charts.d.plugin configuration file.
Default value: $netdata::params::charts_d_cfg_file
charts_d_cfg
Data type: hash
A hash of netdata charts.d.plugin configuration settings.
Default value: $netdata::params::charts_d_cfg
manage_fping_cfg
Data type: boolean
Whether the netdata fping.plugin configuration file is managed.
Default value: $netdata::params::manage_fping_cfg
fping_cfg_file
Data type: string
The path to the netdata fping.plugin configuration file.
Default value: $netdata::params::fping_cfg_file
fping_bin
Data type: string
The fping binary to use for netdata fping.plugin. Use 'absent' to remove from configuration file.
Default value: $netdata::params::fping_bin
fping_hosts
Data type: array
Hosts to fping with netdata fping.plugin.
Default value: $netdata::params::fping_hosts
fping_update_every
Data type: string
The update frequency of the chart for netdata fping.plugin. Use 'absent' to remove from configuration file.
Default value: $netdata::params::fping_update_every
fping_ping_every
Data type: string
The time in milliseconds to ping the hosts with netdata fping.plugin. Use 'absent' to remove from configuration file.
Default value: $netdata::params::fping_ping_every
fping_opts
Data type: string
Other fping options for netdata fping.plugin. Use 'absent' to remove from configuration file.
Default value: $netdata::params::fping_opts
manage_node_d_cfg
Data type: boolean
Whether the netdata node.d.plugin configuration file is managed.
Default value: $netdata::params::manage_node_d_cfg
node_d_cfg_file
Data type: string
The path to the netdata node.d.plugin configuration file.
Default value: $netdata::params::node_d_cfg_file
node_d_cfg
Data type: hash
A hash of netdata node.d.plugin configuration settings.
Default value: $netdata::params::node_d_cfg
manage_python_d_cfg
Data type: boolean
Whether the netdata python.d.plugin configuration file is managed.
Default value: $netdata::params::manage_python_d_cfg
python_d_cfg_file
Data type: string
The path to the netdata python.d.plugin configuration file.
Default value: $netdata::params::python_d_cfg_file
python_d_cfg
Data type: hash
A hash of netdata python.d.plugin configuration settings.
Default value: $netdata::params::python_d_cfg
manage_stream_cfg
Data type: boolean
Whether the netdata stream configuration file is managed.
Default value: $netdata::params::manage_stream_cfg
stream_cfg_file
Data type: string
The path to the netdata stream configuration file.
Default value: $netdata::params::stream_cfg_file
stream_enabled
Data type: boolean
Whether this node should send metrics.
Default value: $netdata::params::stream_enabled
stream_destination
Data type: string
Destination for stream ([PROTOCOL:]HOST[%INTERFACE][:PORT]
).
Default value: $netdata::params::stream_destination
stream_api_key
Data type: string
The API_KEY to use (as the sender).
Default value: $netdata::params::stream_api_key
stream_timeout
Data type: integer
The timeout to connect and send metrics.
Default value: $netdata::params::stream_timeout
stream_default_port
Data type: integer
Default port if not specified by stream_destination
.
Default value: $netdata::params::stream_default_port
stream_buffer_size_bytes
Data type: integer
The buffer to use for sending metrics.
Default value: $netdata::params::stream_buffer_size_bytes
stream_reconnect_delay
Data type: integer
Number of seconds to wait before after connection failure or disconnection.
Default value: $netdata::params::stream_reconnect_delay
stream_initial_clock_resync
Data type: integer
Number of clock sync iteration attempts between sending and receiving netdata hosts when starting.
Default value: $netdata::params::stream_initial_clock_resync
stream_options_per_id
Data type: hash
A hash of configuration settings to be applied per API_KEY or per MACHINE_GUID for netdata sending hosts on netdata receiving host.
Default value: $netdata::params::stream_options_per_id
manage_service
Data type: boolean
Whether the netdata service is managed.
Default value: $netdata::params::manage_service
service_name
Data type: string
The name of the netdata service to run.
Default value: $netdata::params::service_name
ensure_service
Data type: string
Whether the netdata service should be running.
Default value: $netdata::params::ensure_service
enable_service
Data type: boolean
Whether the netdata service should be enabled to start at boot.
Default value: $netdata::params::enable_service
Dependencies
- puppetlabs/stdlib (>= 4.12.0 <5.0.0)