summaryrefslogtreecommitdiff
path: root/puppet/modules/site_nagios/manifests/add_service.pp
blob: 72cd038a6078d5657216be104d627e56a5104cbe (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
define site_nagios::add_service (
  $hostname, $ip_address, $service, $environment, $openvpn_gw = '') {

  $ssh      = hiera_hash('ssh')
  $ssh_port = $ssh['port']

  case $service {
    'webapp': {
      nagios_service {
        "${name}_ssh":
          use                 => 'generic-service',
          check_command       => "check_ssh_port!${ssh_port}",
          service_description => 'SSH',
          host_name           => $hostname,
          contact_groups      => $environment;
        "${name}_cert":
          use                 => 'generic-service',
          check_command       => 'check_https_cert',
          service_description => 'Website Certificate',
          host_name           => $hostname,
          contact_groups      => $environment;
        "${name}_website":
          use                 => 'generic-service',
          check_command       => 'check_https',
          service_description => 'Website',
          host_name           => $hostname,
          contact_groups      => $environment;
      }
    }
    default:  {}
  }
}