Skip to content

Latest commit

 

History

History
687 lines (432 loc) · 17.6 KB

REFERENCE.md

File metadata and controls

687 lines (432 loc) · 17.6 KB

Reference

Table of Contents

Classes

Public Classes

Private Classes

  • munin::master::collect: Helper class to collect the exported munin nodes.
  • munin::node::export: Helper class to export the munin node.

Defined types

Classes

munin::master

The munin master will install munin, and collect all exported munin node definitions as files into /etc/munin/munin-conf.d/.

Examples

Basic usage
include munin::master
With TLS
class { 'munin::master':
  tls             => 'enabled',
  tls_certificate => '/path/to/tls/certificate',
  tls_private_key => '/path/to/tls/key',
}

Parameters

The following parameters are available in the munin::master class:

node_definitions

Data type: Hash

A hash of node definitions used by create_resources to make static node definitions.

host_name

Data type: Stdlib::Host

A host name for this munin master, matched with munin::node::mastername for collecting nodes. Defaults to $::fqdn

This is used for collecting munin::master::node_definition resources exported by nodes using the munin::node class.

graph_strategy

Data type: Enum['cgi', 'cron']

Controls if munin-graph graphs all services ('cron') or if graphing is done by munin-cgi-graph (which must configured seperatly)

html_strategy

Data type: Enum['cgi', 'cron']

Controls if munin-html will recreate all html pages every run interval ('cron') or if html pages are generated by munin-cgi-graph (which must configured seperatly). Defaults to "cgi".

config_root

Data type: Stdlib::Absolutepath

The root directory of the munin master configuration. Default: /etc/munin on most platforms.

file_group

Data type: String

The group name for configuration file permissions.

collect_nodes

Data type: Enum['enabled', 'disabled', 'mine', 'unclaimed']

Controls which nodes to collect.

'enabled' (default) makes the munin master collect all exported node_definitions.

'disabled' disables collection.

'mine' makes the munin master collect nodes matching the $host_name parameter.

'unclaimed' makes the munin master collect nodes not tagged with a host name.

This is used for collecting munin::master::node_definition resources exported by nodes using the munin::node class.

dbdir

Data type: Optional[Stdlib::Absolutepath]

Path to the munin dbdir, where munin stores everything.

htmldir

Data type: Optional[Stdlib::Absolutepath]

Path to where munin will generate HTML documents and graphs, used if graph_strategy is cron.

rundir

Data type: Optional[Stdlib::Absolutepath]

Path to directory munin uses for pid and lock files.

logdir

Data type: Optional[Stdlib::Absolutepath]

Path to directory munin uses for log files.

package_name

Data type: Variant[String,Array[String]]

The package name used for installing the munin master.

tls

Data type: Enum['enabled', 'disabled']

Controls the use of TLS globally for master to node communications. Default 'disabled'.

tls_certificate

Data type: Stdlib::Absolutepath

Path to a file containing a TLS certificate. No default. Required if tls is enabled.

tls_private_key

Data type: Stdlib::Absolutepath

Path to a file containing a TLS key. No default. Required if tls is enabled.

tls_verify_certificate

Data type: Enum['yes','no']

If TLS is used, verify the certificate. Defaults to 'yes'.

extra_config

Data type: Array[String]

Extra lines of config to put in munin.conf.

munin::node

Configure a munin node, and export configuration a munin master can collect.

List of IPv4 and IPv6 addresses and networks to allow remote munin masters to connect. By default, the munin node only permits connections from the local host.

Examples

Basic usage
include munin::node
Permitting a remote munin server to connect
class {'munin::node':
  allow => ['192.0.2.1', '2001:db8::1'],
}

Parameters

The following parameters are available in the munin::node class:

allow

Data type: Array

config_root

Data type: Stdlib::Absolutepath

Root directory for munin configuration.

nodeconfig

Data type: Array

List of lines to append to the munin node configuration.

host_name

Data type: Stdlib::Host

The host name munin node identifies as. Defaults to the $::fqdn fact.

log_dir

Data type: Stdlib::Absolutepath

The log directory for the munin node process. Defaults change according to osfamily, see munin::params::node for details.

log_file

Data type: String

File name for the log file, this is appended to "log_dir". Defaults to "munin-node.log".

log_destination

Data type: Enum['file','syslog']

Configures the log destination. Defaults to "file". If set to "syslog", the "log_file" and "log_dir" parameters are ignored, and the "syslog_*" parameters are used if set.

purge_configs

Data type: Boolean

Removes all munin plugins and munin plugin configuration files not managed by Puppet. Defaults to false.

syslog_facility

Data type:

Optional[
    Variant[
      Integer[0,23],
      Enum[
        'kern','user','mail','daemon','auth','syslog','lpr','news','uucp',
        'authpriv','ftp','cron','local0','local1','local2','local3','local4',
        'local5','local6','local7'
  ]]]

Defaults to undef, which makes munin-node use the perl Net::Server module default of "daemon". Possible values are any syslog facility by number, or lowercase name.

export_node

Data type: Enum['enabled','disabled']

Causes the node config to be exported to puppetmaster. Defaults to "enabled".

This is used for exporting a munin::master::node_definition, to be collected by a node with munin::master.

masterconfig

Data type: Array

List of configuration lines to append to the munin master node definition.

This is used for exporting a munin::master::node_definition, to be collected by a node with munin::master.

mastername

Data type: Optional[Stdlib::Host]

The name of the munin master server which will collect the node definition.

This is used for exporting a munin::master::node_definition, to be collected by a node with munin::master.

mastergroup

Data type: Optional[String]

The group used on the master to construct a FQN for this node. Defaults to "", which in turn makes munin master use the domain. Note: changing this for a node also means you need to move rrd files on the master, or graph history will be lost.

This is used for exporting a munin::master::node_definition, to be collected by a node with munin::master.

plugins

Data type: Hash

A hash used by create_resources to create munin::plugin instances.

address

Data type: String

The address used in the munin master node definition.

bind_address

Data type: Variant[Enum['*'],Stdlib::Host]

The IP address the munin-node process listens on. Defaults: *.

bind_port

Data type: Stdlib::Port

The port number the munin-node process listens on.

package_name

Data type: String

The name of the munin node package to install.

service_name

Data type: String

The name of the munin node service.

service_ensure

Data type: Enum['running','stopped']

Used as parameter "ensure" for the munin node service.

file_group

Data type: String

The UNIX group name owning the configuration files, log files, etc.

timeout

Data type: Optional[Integer[0]]

Set the global plugin runtime timeout for this node. Defaults to undef, which lets munin-node use its default of 10 seconds.

Default value: $munin::params::node::timeout

plugin_share_dir

Data type: Stdlib::Absolutepath

Defined types

munin::master::node_definition

This will add configuration for the munin master to connect to a munin node, and ask for data from its munin plugins.

The resource title is used as the munin FQN, or "fully qualified name". This defines the node name and group. It is common to use the host's fully qualified domain name, where the domain name will be implicitly used as the node group.

Note: By default, using munin::node on a node will create a export a munin::master::node_definition to PuppetDB. The node classified with munin::master will collect all these exported instances.

Examples

A minimal, static node definition
munin::master::node_definition { 'foo.example.com':
  address => '192.0.2.1',
}
A node definition with configuration
munin::master::node_definition { 'bar.example.com':
  address => '192.0.2.2',
  config  => [ 'load.graph_future 30',
               'load.load.trend yes',
               'load.load.predict 86400,12' ],
}
Using a group in the FQN
munin::master::node_definition { 'webservers;web01.example.com':
    address => '192.0.2.3',
}

Parameters

The following parameters are available in the munin::master::node_definition defined type:

address

Data type: String

The address of the munin node. A hostname, an IP address, or a ssh:// uri for munin-async node.

mastername

Data type: Optional[String]

The name of the munin master server which will collect the node definition. This is used when exporting and collecting munin::master::node_definition resources between hosts.

Default value: ''

config

Data type: Array[String]

An array of configuration lines to be added to the node definition.

Default value: []

fqn

Data type: String

The Munin FQN (Fully Qualified Name) of the node. This should be 'hostname', 'group;hostname', 'group;subgroup;hostname').

If a group is not set, munin will by default use the domain of the node as a group, if the node name is a fully qualified host name.

The title of the defined resource should be a munin FQN. See the "fqn" parameter

Default value: $title

munin::plugin

Install and configure munin plugins

Examples

Activate a packaged plugin
munin::plugin { 'cpu':
  ensure => link,
}
Activate a packaged wildcard plugin
munin::plugin { 'foo_bar':
  ensure => link,
  target => 'foo_',
}
Install and activate a plugin
munin::plugin { 'gazonk':
  ensure => present,
  source => 'puppet:///modules/profile/foo/monitoring/gazonk',
}
A plugin with configuration
munin::plugin { 'bletch':
  ensure => link,
  config => ['env.database thing', 'user bletch'],
}
A plugin configuration file, but no plugin
munin::plugin { 'slapd':
  config       => ['env.rootdn cn=admin,dc=example,dc=org'],
  config_label => 'slapd_*',
}

Parameters

The following parameters are available in the munin::plugin defined type:

ensure

Data type: Enum['','present','absent','link']

The ensure parameter is mandatory for installing a plugin.

With "ensure => link", a symlink is created in the munin plugin directory to where the plugin file is installed.

With "ensure => present", the plugin is installed in the munin plugin directory, and the "source" or "content" parameter is required to provide a source for the plugin.

With "ensure => absent", remove the munin plugin.

When ensure is not set, a plugin will not be installed, but extra plugin configuration can be managed with the config and config_label parameters.

Default value: ''

source

Data type: Optional[String]

When ensure => present, path to a source file

Default value: undef

content

Data type: Optional[String[1]]

When ensure => present, content of the plugin.

Default value: undef

checksum

Data type: Optional[String[1]]

Checksum type for the plugin file.

Default value: undef

checksum_value

Data type: Optional[String[1]]

Checksum value for the plugin file.

Default value: undef

target

Data type: String

When "ensure => link", Add a link in the plugin directory to the link target.

If target is an absolute path (starts with "/") it is used directly.

If target is a relative path, $munin::node::plugin_share_dir is prepended.

If target is unset, a link is created to a plugin with the same name in the packaged $munin::node:: plugin_share_dir directory. (In other words, activate a plugin that is already installed)

Default value: ''

config

Data type: Optional[Array[String]]

Lines for the munin plugin config.

Default value: []

config_label

Data type: String

Label for munin plugin config

Default value: $title