diff options
author | Leif Johansson <leifj@sunet.se> | 2015-04-22 15:52:01 +0200 |
---|---|---|
committer | Leif Johansson <leifj@sunet.se> | 2015-04-22 15:52:01 +0200 |
commit | baa40e82a1e0bac6bc11894289ab4cb44a5a8730 (patch) | |
tree | c3704636afd75684837e32f297a18ffe6c5b642f /global/overlay/etc/puppet/modules/sunet/manifests | |
parent | 3aa12a2570f187b179c8631f4eaab0c83d1662b7 (diff) | |
parent | 5a10e87213b5d83209c4f25544fd186bcff9790d (diff) |
Merge branch 'master' of git.nordu.net:sunet-opssunet-ops-2015-04-22-v10
Diffstat (limited to 'global/overlay/etc/puppet/modules/sunet/manifests')
-rw-r--r-- | global/overlay/etc/puppet/modules/sunet/manifests/nagios.pp | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/global/overlay/etc/puppet/modules/sunet/manifests/nagios.pp b/global/overlay/etc/puppet/modules/sunet/manifests/nagios.pp index 58a10bc..b05100e 100644 --- a/global/overlay/etc/puppet/modules/sunet/manifests/nagios.pp +++ b/global/overlay/etc/puppet/modules/sunet/manifests/nagios.pp @@ -1,3 +1,37 @@ class sunet::nagios { + $nagios_ip_v4 = hiera('nagios_ip_v4', '109.105.111.111') + $nagios_ip_v6 = hiera('nagios_ip_v6', '2001:948:4:6::111') + $allowed_hosts = "${nagios_ip_v4},${nagios_ip_v6}" + + package {'nagios-nrpe-server': + ensure => 'installed', + } -> + service {'nagios-nrpe-server': + ensure => 'running' + } -> + file { "/etc/nagios/nrpe.cfg" : + ensure => 'file', + mode => '0640', + group => 'nagios', + content => template('sunet/nagioshost/nrpe.cfg.erb'), + } -> + file { "/usr/lib/nagios/plugins/check_uptime.pl" : + ensure => 'file', + mode => '0751', + group => 'nagios', + content => template('sunet/nagioshost/check_uptime.pl.erb'), + } -> + ufw::allow { "allow-nrpe-v4": + from => "${nagios_ip_v4}", + ip => 'any', + proto => 'tcp', + port => 5666 + } -> + ufw::allow { "allow-nrpe-v6": + from => "${nagios_ip_v6}", + ip => 'any', + proto => 'tcp', + port => 5666 + } } |