Puppet Class: nagios::nrpe::server

Defined in:
manifests/nrpe/server.pp

Overview

Class: nagios::nrpe::server

Installs the check_nrpe plugin and collects the resources tagged with “nagios-$fqdn”. They typically got exported using nagios::service::nrpe.

NB: the class name can be confusing. The idea is that central nodes are nagios “servers”, even if they just execute plugins.

Example usage:

include nagios
include nagios::nrpe::server


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
# File 'manifests/nrpe/server.pp', line 14

class nagios::nrpe::server {
  include ::nagios::params

  case $::osfamily {
    'Debian': {
      package {'nagios-nrpe-plugin':
        ensure => present,
      }
    }
    'RedHat': {
      package {'nagios-plugins-nrpe':
        ensure => present,
      }
    }

    default: { fail ("OS family ${::osfamily} not yet implemented !")}
  }

  $get_tag = "nagios-${::nagios::nrpe_server_tag}"

  Nagios::Host   <<| tag == $get_tag |>>
  Nagios_service <<| tag == $get_tag |>>
  Nagios_command <<| tag == $get_tag |>>
  File           <<| tag == $get_tag |>>

  Nagios_host    { require => File[$nagios::params::resourcedir] }
  Nagios_service { require => File[$nagios::params::resourcedir] }
  Nagios_command { require => File[$nagios::params::resourcedir] }

}