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'])

    Enables or disables module.

  • module_dir (Stdlib::Absolutepath) (defaults to: "${icingaweb2::globals::default_module_path}/graphite")

    Target directory of the module.

  • git_repository (Stdlib::HTTPUrl)

    Set a git repository URL.

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

    Set either a branch or a tag name, eg. ‘master` or `v1.3.2`.

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

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

  • package_name (String[1])

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

  • url (Optional[Stdlib::HTTPUrl]) (defaults to: undef)

    URL to your Graphite Web/API.

  • insecure (Optional[Boolean]) (defaults to: undef)

    Do not verify the TLS certificate.

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

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

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

    The users password.

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

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

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

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

  • customvar_obscured_check_command (Optional[String[1]]) (defaults to: undef)

    The Icinga custom variable with the ‘actual` check command obscured by e.g. check_by_ssh.

  • default_time_range_unit (Optional[Enum[ 'minutes', 'hours', 'days', 'weeks', 'months', 'years' ]]) (defaults to: undef)

    Set unit for the time range.

  • default_time_range (Optional[Integer[1]]) (defaults to: undef)

    Set the displayed time range.

  • disable_no_graphs (Optional[Boolean]) (defaults to: undef)

    Do not display empty graphs.



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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
# File 'manifests/module/graphite.pp', line 62

class icingaweb2::module::graphite (
  Enum['absent', 'present']         $ensure,
  Stdlib::HTTPUrl                   $git_repository,
  Enum['git', 'none', 'package']    $install_method,
  String[1]                         $package_name,
  Stdlib::Absolutepath              $module_dir                            = "${icingaweb2::globals::default_module_path}/graphite",
  Optional[String[1]]               $git_revision                          = undef,
  Optional[Stdlib::HTTPUrl]         $url                                   = undef,
  Optional[Boolean]                 $insecure                              = undef,
  Optional[String[1]]               $user                                  = undef,
  Optional[Icinga::Secret]          $password                              = undef,
  Optional[String[1]]               $graphite_writer_host_name_template    = undef,
  Optional[String[1]]               $graphite_writer_service_name_template = undef,
  Optional[String[1]]               $customvar_obscured_check_command      = undef,
  Optional[Enum[
      'minutes', 'hours', 'days',
      'weeks', 'months', 'years'
  ]]                                $default_time_range_unit               = undef,
  Optional[Integer[1]]              $default_time_range                    = undef,
  Optional[Boolean]                 $disable_no_graphs                     = undef,
) {
  require icingaweb2

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

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

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

  $ui_settings = {
    'default_time_range'      => $default_time_range,
    'default_time_range_unit' => $default_time_range_unit,
    'disable_no_graphs_found' => $disable_no_graphs,
  }

  $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),
    },
    'module-graphite-ui' => {
      'section_name' => 'ui',
      'target'       => "${module_conf_dir}/config.ini",
      'settings'     => delete_undef_values($ui_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,
  }
}