Puppet Class: icinga::naggen

Defined in:
modules/icinga/manifests/naggen.pp

Overview

Class: icinga::naggen

Runs naggen2 to generate hosts, service and hostext config from exported puppet resources

Parameters:



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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# File 'modules/icinga/manifests/naggen.pp', line 5

class icinga::naggen (
    String $icinga_user,
    String $icinga_group,
){
    include ::icinga
    $dbarg = $::use_puppetdb ? {
        true    => '--puppetdb',
        default => '--activerecord',
    }

    file { '/etc/icinga/objects/puppet_hosts.cfg':
      content => generate(
          '/usr/local/bin/naggen2', $dbarg, '--type', 'hosts'),
      backup  => false,
      owner   => $icinga_user,
      group   => $icinga_group,
      mode    => '0644',
      notify  => Service['icinga'],
    }

    file { '/etc/icinga/objects/puppet_services.cfg':
      content => generate(
          '/usr/local/bin/naggen2', $dbarg, '--type', 'services'),
      backup  => false,
      owner   => $icinga_user,
      group   => $icinga::icinga_group,
      mode    => '0644',
      notify  => Service['icinga'],
    }

    # Collect all (virtual) resources
    Monitoring::Group <| |> {
        notify  => Service['icinga'],
    }
    Monitoring::Host <| |> {
        notify  => Service['icinga'],
    }
    Monitoring::Service <| tag != 'nrpe' |> {
        notify  => Service['icinga'],
    }

}