Puppet Class: psick::prometheus::alertmanager

Defined in:
manifests/prometheus/alertmanager.pp

Overview

class psick::prometheus::alertmanager

Manages the prometheus server alertmanager

Parameters:

  • mail_rcpt (String)

    specify an email address which should receive alerts

  • stmp_smarthost

    default to localhost

  • version (String) (defaults to: '0.8.0')

    specify version of alertmanager to use defaults to 0.8.0

  • smtp_smarthost (String) (defaults to: 'localhost')


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 'manifests/prometheus/alertmanager.pp', line 9

class psick::prometheus::alertmanager (
  String $mail_rcpt,
  String $smtp_smarthost = 'localhost',
  String $version        = '0.8.0',
){
  class { '::prometheus::alertmanager':
    manage_user    => true,
    manage_group   => true,
    user           => 'prometheus',
    group          => 'prometheus',
    bin_dir        => '/opt/prometheus/alertmanager-0.8.0.linux-amd64',
    version        => $version,
    install_method => 'package',
    package_name   => 'prometheus-alertmanager',
    package_ensure => present,
    route          => {
      group_by        => ['alertname', 'cluster', 'service'],
      group_wait      => '30s',
      group_interval  => '5m',
      repeat_interval => '3h',
      receiver        => 'Admin',
    },
    global         => {
      smtp_smarthost => $smtp_smarthost,
      smtp_from      => "alertmanager@${::facts['networking']['fqdn']}",
    },
    receivers      => [
      {
        name          => 'Admin',
        email_configs => [
          {
            to => $mail_rcpt,
          },
        ],
      },
    ],
  }
}