aboutsummaryrefslogtreecommitdiff
path: root/manifests/subsystem/monitor/munin.pp
blob: c2f461ac7135c5890a0ca818eb8091ff17aff78d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# Define a munin node
define nodo::subsystem::monitor::munin(
  $manage        = hiera('nodo::munin_node::manage', True),
  $port          = hiera('nodo::munin_node::port',   '4949'),
  $allow         = hiera('nodo::munin_node::allow',  ''),
  $host          = hiera('nodo::munin_node::host',    $::fqdn),
  $listen        = hiera('nodo::munin_node::listen', '*'),
  $config        = hiera('nodo::munin_node::config', [ 'use_node_name yes', 'load.load.warning 5', 'load.load.critical 10' ])
) {

  if $manage == true {
    case $allow {
      '': { fail("Please set nodo::munin_node::allow in your config") }
    }

    package { "munin-plugins-extra":
      ensure => "present",
    }

    class { 'munin::client':
      port   => $port,
      allow  => $allow,
      host   => $host,
      listen => $listen,
      config => $config,
    }

    munin::plugin { apt_all: ensure => present; }
  }
}