Puppet Class: checkmk

Defined in:
manifests/init.pp

Summary

A module for managing CheckMK

Overview

Configures a CheckMK server or agent

Examples:

# CheckMK Server
class { '::checkmk':
  mode        => 'server',
  sha256_hash => '8804c0291e897f6185b147613a5fc86d61c0bcf73eaac5b11d90afe58af10c9f', # get from https://checkmk.com/download
}

# CheckMK Agent
class { '::checkmk':
  mode                        => 'agent',
  agent_download_host         => 'checkmk.example.com',
  agent_download_bearer_token => '1234567890',
}

Parameters:

  • version (String)

    The version of CheckMK server to install

  • download_url (Optional[String])

    The URL to download the CheckMK server from The default URL is derived from the version defined and the host codename

  • sha256_hash (String)

    The SHA256 hash of the CheckMK server package

  • mode (String)

    Install mode for either ‘server’ or ‘agent’

  • site_name (String)

    The site name for the CheckMK server

  • cmkadmin_user_password (Optional[String])

    The password for the “cmkadmin” user, required when using mode => ‘server’

  • agent_download_protocol (String)

    Either ‘http’ or ‘https’ for the server URL

  • agent_download_host (String)

    The hostname to download the agent package from

  • automation_user_password (String)

    The password for the “automation” user

  • agent_folder (String)

    The folder in CheckMK Hosts to create the host in

  • hostname (String)

    The hostname for the CheckMK agent

  • agent_package_ensure (Enum[latest, present, absent])


31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# File 'manifests/init.pp', line 31

class checkmk (
  String $version,
  Optional[String] $download_url,
  String $sha256_hash,
  String $mode,
  String $site_name,
  Optional[String] $cmkadmin_user_password,
  Enum[latest, present, absent] $agent_package_ensure,
  String $agent_download_protocol,
  String $agent_download_host,
  String $automation_user_password,
  String $agent_folder,
  String $hostname,
) {
  unless $site_name =~ /^[a-z_]([a-z0-9_-]{0,31}|[a-z0-9_-]{0,30}\$)$/ {
    fail('site_name must be a valid CheckMK site name')
  }

  case $mode {
    'server': {
      class { 'checkmk::install::server': }
      -> class { 'checkmk::install::agent': }
    }
    'agent': {
      class { 'checkmk::install::agent': }
    }
    default: {
      fail('checkmk::mode must be either "server" or "agent"')
    }
  }
}