Puppet Class: nagios

Defined in:
manifests/init.pp

Overview

Class: nagios

Namespace for nagios module, it also defines the current platform specific defaults for file locations and names

Parameters

user

The user which the nrpe client and server should run as

group

The group which the nrpe client and server should run as

manage_user

If the user should be managed

manage_group

If the group should be managed

manage_plugins_path

If the plugins path should be managed

Authors

Christopher Johnson - cjohn@ceh.ac.uk

Parameters:

  • user (Any) (defaults to: 'nagios')
  • group (Any) (defaults to: 'nagios')
  • manage_user (Any) (defaults to: true)
  • manage_group (Any) (defaults to: true)
  • manage_plugins_path (Any) (defaults to: true)


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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# File 'manifests/init.pp', line 18

class nagios (
  $user                = 'nagios',
  $group               = 'nagios',
  $manage_user         = true,
  $manage_group        = true,
  $manage_plugins_path = true
) {
  $nrpe_package = $::osfamily ? {
    Darwin  => 'nrpe',
    RedHat  => 'nrpe',
    default => 'nagios-nrpe-server'
  }

  $package_provider = $::osfamily ? {
    Darwin  => 'brew',
    default => undef
  }

  $nrpe_config = $::osfamily ? {
    Darwin  => '/usr/local/etc/nrpe.cfg',
    RedHat  => '/etc/nagios/nrpe.cfg',
    default => '/etc/nagios/nrpe_local.cfg'
  }

  $nrpe_service = $::osfamily ? {
    Darwin  => 'org.nrpe.agent',
    RedHat  => 'nrpe',
    default => 'nagios-nrpe-server'
  }

  $nrpe_plugins = $::osfamily ? {
    RedHat  => 'nagios-plugins-all',
    default => 'nagios-plugins',
  }

  $plugins_path = $::osfamily ? {
    Darwin  => '/usr/local/opt/nagios-plugins/sbin',
    RedHat  => '/usr/lib64/nagios/plugins',
    default => '/usr/lib/nagios/plugins'
  }

  if $manage_plugins_path {
    file { $plugins_path :
      ensure => directory,
    }
  }

  if $manage_user {
    user { $user :
      ensure => present,
    }
  }

  if $manage_group {
    group { $group :
      ensure => present,
    }
  }
}