summaryrefslogtreecommitdiffstats
path: root/manifests/monitoring/service/postfix_mailqueue.pp
blob: 0f7a9c156834fa21c3315b68613c1c4cdd40853a (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
31
32
33
34
35
# Manages the monitoring of Postfix mail queue

define tails::monitoring::service::postfix_mailqueue (
  String $nodename,
  String $zone,
  Enum['present', 'absent'] $ensure = present,
  String $check_interval            = '1h',
  String $retry_interval            = '5m',
  Optional[String] $display_name    = undef,
  Boolean $enable_notifications     = true,
  Stdlib::Absolutepath $config_dir  = '/etc/postfix',
  # Thresholds apply to every queue except "corrupt",
  # which has critical=1 by default in the check script.
  Integer[0] $warning_threshold     = 5,
  Integer[0] $critical_threshold    = 5,
){

  if $display_name == undef {
    $displayed_name = $name
  } else {
    $displayed_name = $display_name
  }

  include ::tails::monitoring::checkcommand::postfix_mailqueue

  file { "/etc/icinga2/zones.d/${zone}/postfix_mailqueue_${name}.conf":
    ensure  => $ensure,
    owner   => 'nagios',
    group   => 'nagios',
    mode    => '0600',
    content => template('tails/monitoring/service/postfix_mailqueue.erb'),
    notify  => Service['icinga2'],
  }

}