Version information
This version is compatible with:
- CentOS,Debian,OracleLinux,RedHat,Scientific, SmartOS,Ubuntu, FreeBSD, DragonFly, OpenBSD
Start using this module
Add this module to your Puppetfile:
mod 'ssm-munin', '0.0.8'
Learn more about managing modules with a PuppetfileDocumentation
Puppet munin module 
Control munin master, munin node, and munin plugins.
Munin nodes are automatically configured on the master. (Requires puppetdb)
Munin master
Typical usage:
include munin::master
Installs a munin master, and automatically collects configuration from all munin nodes configured with munin::node.
Munin node definition
munin::master::node_definition { 'fqn':
address => $address,
config => ['additional', 'configuration' 'lines'],
}
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.
The address is the host name, ip address, or alternate transport used to contact the node.
To add more configuration, specify it as an array for the "config" attribute.
For more information about configuring a munin node definition, see http://munin.readthedocs.org/en/latest/reference/munin.conf.html#node-definitions
If you have multiple munin master servers in your infrastructure and want to assign different nodes to different masters, you can specify the master's fully qualified domain name on the node's definition:
munin::master::node_definition { 'fqn':
address => $address,
mastername => 'munin.example.com',
}
Static node definitions
The munin master class will collect all "munin::master::node_definition" exported by "munin::node".
For extra nodes, you can define them in hiera, and munin::master will create them. Example:
munin::master::node_definition { 'foo.example.com':
address => '192.0.2.1'
}
munin::master::node_definition { 'bar.example.com':
address => '192.0.2.1',
config => [ 'load.graph_future 30',
'load.load.trend yes',
'load.load.predict 86400,12' ],
}
node definitions as class parameter
If you define your nodes as a data structure in a puppet manifest, or from the puppet External Node Classifier, you can use a class parameter:
$nodes = { ... }
class { 'puppet::master':
node_definitions => $nodes,
}
node definitions with hiera
A JSON definition.
{
"munin::master::node_definitions" : {
"foo.example.com" : {
"address" : "192.0.2.1"
},
"bar.example.com" : {
"address" : "192.0.2.2",
"config" : [
"load.graph_future 30",
"load.load.trend yes",
"load.load.predict 86400,12"
]
}
}
}
A YAML definition
---
munin::master::node_definitions:
foo.example.com:
address: 192.0.2.1
bar.example.com:
address: 192.0.2.2
config:
- load.graph_future 30
- load.load.trend yes
- load.load.predict 86400,12
Munin node
Typical usage:
class { 'munin::node':
allow => [ '192.0.2.0/24', '2001:db8::/64' ]
}
or in hiera:
---
munin::node::allow:
- 192.0.2.0/24
- 2001:db8::/64
Installs munin-node, and exports a munin::master::node_definition which munin::master will collect, and allows munin masters on specified networks to connect.
The munin::node class does take more parameters, see the 'manifests/node.pp' file for complete documentation.
Munin plugins
The defined type munin::plugin is used to control the munin plugins used on a munin node.
Typical usage:
munin::plugin { 'cpu':
ensure => link,
}
Examples
Activate a plugin
Here, we activate an already installed plugin.
The use of "ensure => link" creates an implicit "target => /usr/share/munin/plugins/$title".
The "target" parameter can be set to an absolute path (starting with a "/"), or a relative path (anything else). If relative, $munin::params::node::plugin_share_dir is prepended to the path.
munin::plugin {
'apt':
ensure => link;
'something':
ensure => link,
target => '/usr/local/share/munin/plugins/something';
'ip_eth0':
ensure => link,
target => 'ip_'; # becomes $munin::params::node::plugin_share_dir/ip_
}
Install and activate a plugin
The use of "ensure => present" creates a file in /etc/munin/plugins
munin::plugin { 'somedaemon':
ensure => present,
source => 'puppet:///modules/munin/plugins/somedaemon',
}
Activate wildcard plugin
A pair of plugins we provide, with a _name symlink (This is also known as "wildcard" plugins)
munin::plugin {
'foo_bar':
ensure => present,
target => 'foo_',
source => 'puppet:///modules/munin/plugins/foo_';
'foo_baz':
ensure => present,
target => 'foo_',
source => 'puppet:///modules/munin/plugins/foo_';
}
Plugin with configuration
This creates an additional "/etc/munin/plugin-conf.d/${title}.conf"
munin::plugin {
'bletch':
ensure => link,
config => 'env.database flumpelump';
'thud':
ensure => present,
source => 'puppet:///modules/munin/plugins/thud',
config => ['env.database zotto', 'user root'];
}
A plugin configuration file
This only adds a plugin configuration file.
munin::plugin { 'slapd':
config => ['env.rootdn cn=admin,dc=example,dc=org'],
config_label => 'slapd_*',
}
Changelog
0.0.8 - 2015-02-06
Support the future parser.
Contributors to this release: Rike-Benjamin Schuppner, Stig Sandbeck Mathisen
0.0.7 - 2014-12-05
This release adds support for DragonFly BSD, FreeBSD, OpenBSD.
Other changes listed below, per component.
Contributors to this release: Alex Hornung, Chris Roddy, Frank Groeneveld, Fredrik Thulin, Julien Pivotto, Martin Jackson, Sebastian Wiesinger, Stig Sandbeck Mathisen
munin::node
-
Add "host_name" parameter to override the host name of the munin node.
-
Add "file_group" parameter, used for configuration and log files.
-
Add "log_dir" parameter.
-
Improved handling of "allow" ACL parameter.
munin::master
-
Improved collection logic. Set "collect_nodes" to "mine" to collect nodes which are targeted for this master, or "unclaimed" to pick up nodes not aimed a specific master.
-
Add global tls_* parameters for connecting to nodes.
-
Add "dbdir", "htmldir", "rundir" parameters.
-
Add "extra_config" parameter, which takes an array of extra configuration lines for munin.conf.
munin::plugin
- Support absolute paths as target for a plugin.
0.0.6 - 2014-12-05
- Retracted, had a breaking bug on older (3.4.x) puppet versions.
0.0.5 - 2014-03-19
-
Support multiple masters with different nodes (Thanks: Cristian Gae)
-
Support older (1.4.6) munin versions (Thanks: Sergio Oliveira)
-
Update for compatibility with puppet 3.4 (Thanks: Harald Skoglund)
-
Easier configuration with more parameters. All parameters have trivial validation.
munin::master
- new parameter "config_root". Defaults should match supported operating systems.
munin::plugin
- new parameter "config_root". Defaults should match supported operating systems.
munin::node
-
new parameter "address". Default is $::fqdn. This will be used as the "address" when registering with the munin master.
-
new parameter "config_root". Defaults should match supported operating systems.
-
new parameter "package_name". Default should match supported operating systems.
-
new parameter "service_name". Default should match supported operating systems.
-
new parameter "service_ensure". Default is "". Possible values: "", "running" or "stopped".
munin::params
- new class
0.0.4 - 2013-08-13
Bugfix for the munin::plugin define.
-
Bugfix: Ensure that we can run tests on ruby 1.8.
-
Bugfix: No longer requires the class
Munin::Plugins
, which does not exist in this module. (#3) -
The
ensure
attribute no longer defaults to "link". If not set, a potentially existing plugin with the same name is not touched. -
Plugin and configuration directories are now configurable.
-
Improved rspec tests, which now actually match the documentation.
0.0.2 - 2013-06-31
A few pull requests
-
Bugfix: Install munin package before creating munin-conf.d directory (#1)
-
Make graph strategy configurable (#2)
-
Improve documentation
0.0.1 - 2013-06-02
Initial release
Dependencies
- puppetlabs/stdlib (>= 2.3.0)