Puppet Class: psick::monitor::check_mk

Defined in:
manifests/monitor/check_mk.pp

Overview

This class manages the installation and configuation of checkMK

Parameters:

  • server (Optional[String]) (defaults to: undef)

    The monitor server hostname

  • port (String) (defaults to: '6522')

    The port to use

  • interval (String) (defaults to: '120')

    The check interval



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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
# File 'manifests/monitor/check_mk.pp', line 7

class psick::monitor::check_mk (
  Optional[String] $server    = undef,
  String $port                = '6522',
  String $interval            = '120',
) {

  $packages = $::osfamily ? {
    'RedHat' => [ 'check_mk-agent' , 'check_mk-agent-logwatch' ] ,
    'Debian' => [ 'check_mk-agent' , 'check_mk-agent-logwatch' ] ,
    'Suse'   => [ 'check_mk-agent' , 'check_mk-agent-logwatch' , 'check_mk-plugins'],
    'RedHat' => [ 'check_mk-agent' , 'check_mk-agent-logwatch' ,
    'check_mk-plugins'],
    'Suse' => [ 'check_mk-agent' , 'check_mk-agent-logwatch' ,
    'check_mk-plugins'],
    default  => [],
  }

  $init_script = $::osfamily ? {
    'Debian' => '/etc/default/cmk-passiv',
    default  => '/etc/sysconfig/cmk-passiv',
  }

  $packages.each |$pkg| {
    ensure_packages($pkg)
  }

  if $packages != [] {
    service { 'cmk-passiv':
      ensure  => running,
      enable  => true,
      require => Package['check_mk-agent'],
    }

    if $server {
      file { $init_script:
        content => "${server} ${interval} ${port}\n",
        notify  => Service['cmk-passiv'],
        require => Package['check_mk-agent'],
      }
    }
  }

}