Puppet Class: r_profile::monitor::nagios_monitored

Defined in:
manifests/monitor/nagios_monitored.pp

Overview

R_profile::Monitor::Nagios_monitored

Configure nagios to monitor something

Parameters:

  • nagios_server (Any) (defaults to: hiera('r_profile::monitor::nagios_monitored::nagios_server', false))


4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'manifests/monitor/nagios_monitored.pp', line 4

class r_profile::monitor::nagios_monitored(
  $nagios_server = hiera('r_profile::monitor::nagios_monitored::nagios_server', false),
) {

  # sometimes we might need to determine the incoming ethernet adaptor to use for
  # checks in multi-honed environments to allow PING or simulate dns
  if $nagios_server {
    $local_ip = $source_ipaddress[$nagios_server]
  } else {
    $local_ip = undef
  }

  class { 'nagios':
    local_ip      => $local_ip,
  }

  @@nagios_host { $fqdn:
    ensure  => present,
    address => $local_ip,
    use     => "${downcase($kernel)}-server",
  }

}