Puppet Class: icingaweb2::module::graphite

Defined in:
manifests/module/graphite.pp

Summary

The Graphite module draws graphs out of time series data stored in Graphite.

Overview

Note:

If you want to use ‘git` as `install_method`, the CLI `git` command has to be installed. You can manage it yourself as package resource or declare the package name in icingaweb2 class parameter `extra_packages`.

Note:

Here the official [Graphite module documentation](www.icinga.com/docs/graphite/latest/) can be found.

Examples:

class { 'icingaweb2::module::graphite':
  git_revision => 'v0.9.0',
  url          => 'https://localhost:8080'
}

Parameters:

  • ensure (Enum['absent', 'present']) (defaults to: 'present')

    Enables or disables module.

  • module_dir (Optional[Stdlib::Absolutepath]) (defaults to: undef)

    Target directory of the module.

  • git_repository (String) (defaults to: 'https://github.com/Icinga/icingaweb2-module-graphite.git')

    Set a git repository URL.

  • install_method (Enum['git', 'none', 'package']) (defaults to: 'git')

    Install methods are ‘git`, `package` and `none` is supported as installation method.

  • package_name (String) (defaults to: 'icingaweb2-module-graphite')

    Package name of the module. This setting is only valid in combination with the installation method ‘package`.

  • url (Optional[String]) (defaults to: undef)

    URL to your Graphite Web/API.

  • user (Optional[String]) (defaults to: undef)

    A user with access to your Graphite Web via HTTP basic authentication.

  • password (Optional[Icingaweb2::Secret]) (defaults to: undef)

    The users password.

  • graphite_writer_host_name_template (Optional[String]) (defaults to: undef)

    The value of your Icinga 2 GraphiteWriter’s attribute ‘host_name_template` (if specified).

  • graphite_writer_service_name_template (Optional[String]) (defaults to: undef)

    The value of your icinga 2 GraphiteWriter’s attribute ‘service_name_template` (if specified).

  • git_revision (Optional[String]) (defaults to: undef)


44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# File 'manifests/module/graphite.pp', line 44

class icingaweb2::module::graphite(
  Enum['absent', 'present']      $ensure                                = 'present',
  Optional[Stdlib::Absolutepath] $module_dir                            = undef,
  String                         $git_repository                        = 'https://github.com/Icinga/icingaweb2-module-graphite.git',
  Optional[String]               $git_revision                          = undef,
  Enum['git', 'none', 'package'] $install_method                        = 'git',
  String                         $package_name                          = 'icingaweb2-module-graphite',
  Optional[String]               $url                                   = undef,
  Optional[String]               $user                                  = undef,
  Optional[Icingaweb2::Secret]   $password                              = undef,
  Optional[String]               $graphite_writer_host_name_template    = undef,
  Optional[String]               $graphite_writer_service_name_template = undef
) {

  $conf_dir        = $::icingaweb2::globals::conf_dir
  $module_conf_dir = "${conf_dir}/modules/graphite"

  $graphite_settings = {
    'url'      => $url,
    'user'     => $user,
    'password' => icingaweb2::unwrap($password),
  }

  $icinga_settings = {
    'graphite_writer_host_name_template'    => $graphite_writer_host_name_template,
    'graphite_writer_service_name_template' => $graphite_writer_service_name_template,
  }

  $settings = {
    'module-graphite-graphite' => {
      'section_name' => 'graphite',
      'target'       => "${module_conf_dir}/config.ini",
      'settings'     => delete_undef_values($graphite_settings)
    },
    'module-graphite-icinga' => {
      'section_name' => 'icinga',
      'target'       => "${module_conf_dir}/config.ini",
      'settings'     => delete_undef_values($icinga_settings)
    }
  }

  icingaweb2::module { 'graphite':
    ensure         => $ensure,
    git_repository => $git_repository,
    git_revision   => $git_revision,
    install_method => $install_method,
    module_dir     => $module_dir,
    package_name   => $package_name,
    settings       => $settings,
  }

}