Puppet Class: nagios::server::nrpe

Defined in:
manifests/server/nrpe.pp

Overview

NRPE config for the Nagios server

Parameters:

  • firewall (Any)
  • nrpe_plugin_package (Any)


2
3
4
5
6
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
# File 'manifests/server/nrpe.pp', line 2

class nagios::server::nrpe (
  $firewall,
  $nrpe_plugin_package,
) {

  # Install plugin to query NRPE on clients
  package { 'nagios-plugins-nrpe':
    ensure => installed,
    name   => $nrpe_plugin_package,
  }

  # Define Nagios command to run NRPE checks
  nagios_command { 'check_nrpe':
    command_line => '$USER1$/check_nrpe -u -H $HOSTADDRESS$ -t 20 -c $ARG1$',
    tag          => hiera('nagios_server'),
  }

  if ($firewall) {
    # Auto-add a firewall rule in the NRPE clients just for us
    @@firewall { "100-nrpe-${::fqdn}":
      proto  => 'tcp',
      dport  => '5666',
      tag    => 'nrpe',
      source => $::ipaddress,
      action => 'accept',
    }
    @@firewall { "100-nrpe-v6-${::fqdn}":
      proto    => 'tcp',
      dport    => '5666',
      tag      => 'nrpe',
      source   => $::ipaddress6,
      provider => 'ip6tables',
      action   => 'accept',
    }
  }
}