diff options
author | Fredrik Thulin <fredrik@thulin.net> | 2015-04-26 09:10:42 +0200 |
---|---|---|
committer | Fredrik Thulin <fredrik@thulin.net> | 2015-04-26 09:10:42 +0200 |
commit | 1d27bd18a1c03ae9fa9d3afb7fdc5bf401a23e94 (patch) | |
tree | 700453a90c269410c0101853eb940c9996e4d452 /global/overlay/etc/puppet/modules/sunet/manifests/nagios.pp | |
parent | d6a0cfe99e4b5b91307386e6746bf3587f3b32bb (diff) | |
parent | deeb38e36bf12b51535cae4a6e61ab145a0720d6 (diff) |
Merge branch 'master' of git.nordu.net:sunet-opssunet-ops-2015-04-26-v01
Diffstat (limited to 'global/overlay/etc/puppet/modules/sunet/manifests/nagios.pp')
-rw-r--r-- | global/overlay/etc/puppet/modules/sunet/manifests/nagios.pp | 49 |
1 files changed, 49 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 new file mode 100644 index 0000000..91ccf6c --- /dev/null +++ b/global/overlay/etc/puppet/modules/sunet/manifests/nagios.pp @@ -0,0 +1,49 @@ +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', + enable => 'true', + require => Package['nagios-nrpe-server'], + } + file { "/etc/nagios/nrpe.cfg" : + notify => Service['nagios-nrpe-server'], + ensure => 'file', + mode => '0640', + group => 'nagios', + require => Package['nagios-nrpe-server'], + content => template('sunet/nagioshost/nrpe.cfg.erb'), + } + file { "/usr/lib/nagios/plugins/check_uptime.pl" : + ensure => 'file', + mode => '0751', + group => 'nagios', + require => Package['nagios-nrpe-server'], + content => template('sunet/nagioshost/check_uptime.pl.erb'), + } + file { "/usr/lib/nagios/plugins/check_reboot" : + ensure => 'file', + mode => '0751', + group => 'nagios', + require => Package['nagios-nrpe-server'], + content => template('sunet/nagioshost/check_reboot.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 + } +} |