Puppet Class: nagios::nrpe::config

Defined in:
manifests/nrpe/config.pp

Overview

Class: nagios::nrpe::config

This will perform the configuration of the nrpe so that it allows the server to connect to it.

Variables

server

This is the ip address for the nagios server, which will be added to the allowed host line in the nagios nrpe config. Required.

monitoring_environment

This is the environment that the check will be submitted for. This will set the default for all checks added to nodes. Required.

nagios_service

This is the generic service that this check will implement. This will set the default for all checks added to nodes. Required.

Authors

Ben Field <ben.field@concreteplatform.com

Parameters:

  • server (Any)
  • nagios_service (Any)
  • monitoring_environment (Any)


23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'manifests/nrpe/config.pp', line 23

class nagios::nrpe::config ($server, $nagios_service, $monitoring_environment) {
  require nagios::nrpe::package
  include nagios::nrpe::service

  $hosts = "allowed_hosts=127.0.0.1,${server}"

  file_line { 'allowed_hosts':
    ensure => present,
    line   => $hosts,
    path   => '/etc/nagios/nrpe.cfg',
    match  => '^allowed_hosts',
    notify => Service['nagios-nrpe-server'],
  }

}