From f94d6450abfa20d3e855216eb094abdfedae0b29 Mon Sep 17 00:00:00 2001 From: Leif Johansson Date: Tue, 14 Apr 2015 15:48:05 +0200 Subject: nagios placeholder --- global/overlay/etc/puppet/modules/sunet/manifests/nagios.pp | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 global/overlay/etc/puppet/modules/sunet/manifests/nagios.pp (limited to 'global/overlay/etc/puppet/modules/sunet/manifests/nagios.pp') 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..58a10bc --- /dev/null +++ b/global/overlay/etc/puppet/modules/sunet/manifests/nagios.pp @@ -0,0 +1,3 @@ +class sunet::nagios { + +} -- cgit v1.1 From 9a6c9b342db6b00f2786edca1d974540a766b1cf Mon Sep 17 00:00:00 2001 From: Dennis Wallberg Date: Wed, 22 Apr 2015 14:58:29 +0200 Subject: nagios configuration update --- .../etc/puppet/modules/sunet/manifests/nagios.pp | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'global/overlay/etc/puppet/modules/sunet/manifests/nagios.pp') diff --git a/global/overlay/etc/puppet/modules/sunet/manifests/nagios.pp b/global/overlay/etc/puppet/modules/sunet/manifests/nagios.pp index 58a10bc..6b7d836 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 => '0640', + 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 + } } -- cgit v1.1 From 5a10e87213b5d83209c4f25544fd186bcff9790d Mon Sep 17 00:00:00 2001 From: Dennis Wallberg Date: Wed, 22 Apr 2015 15:49:01 +0200 Subject: nrpe plugin permission + fixes --- global/overlay/etc/puppet/modules/sunet/manifests/nagios.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'global/overlay/etc/puppet/modules/sunet/manifests/nagios.pp') diff --git a/global/overlay/etc/puppet/modules/sunet/manifests/nagios.pp b/global/overlay/etc/puppet/modules/sunet/manifests/nagios.pp index 6b7d836..b05100e 100644 --- a/global/overlay/etc/puppet/modules/sunet/manifests/nagios.pp +++ b/global/overlay/etc/puppet/modules/sunet/manifests/nagios.pp @@ -18,7 +18,7 @@ class sunet::nagios { } -> file { "/usr/lib/nagios/plugins/check_uptime.pl" : ensure => 'file', - mode => '0640', + mode => '0751', group => 'nagios', content => template('sunet/nagioshost/check_uptime.pl.erb'), } -> -- cgit v1.1 From a60382a9ef96e350036c693ddf7b6be3ec5083fd Mon Sep 17 00:00:00 2001 From: Johan Lundberg Date: Wed, 22 Apr 2015 16:00:50 +0200 Subject: Added notify and dependencies for nagios service and files. --- global/overlay/etc/puppet/modules/sunet/manifests/nagios.pp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'global/overlay/etc/puppet/modules/sunet/manifests/nagios.pp') diff --git a/global/overlay/etc/puppet/modules/sunet/manifests/nagios.pp b/global/overlay/etc/puppet/modules/sunet/manifests/nagios.pp index b05100e..c09679d 100644 --- a/global/overlay/etc/puppet/modules/sunet/manifests/nagios.pp +++ b/global/overlay/etc/puppet/modules/sunet/manifests/nagios.pp @@ -8,18 +8,23 @@ class sunet::nagios { ensure => 'installed', } -> service {'nagios-nrpe-server': - ensure => 'running' + 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'), } -> ufw::allow { "allow-nrpe-v4": -- cgit v1.1 From 877abf0d9b4f0b05425f82bb648d7f9c2215c3fa Mon Sep 17 00:00:00 2001 From: Dennis Wallberg Date: Wed, 22 Apr 2015 16:13:19 +0200 Subject: typo --- global/overlay/etc/puppet/modules/sunet/manifests/nagios.pp | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'global/overlay/etc/puppet/modules/sunet/manifests/nagios.pp') diff --git a/global/overlay/etc/puppet/modules/sunet/manifests/nagios.pp b/global/overlay/etc/puppet/modules/sunet/manifests/nagios.pp index c09679d..cbd47a0 100644 --- a/global/overlay/etc/puppet/modules/sunet/manifests/nagios.pp +++ b/global/overlay/etc/puppet/modules/sunet/manifests/nagios.pp @@ -27,6 +27,13 @@ class sunet::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'), + } -> ufw::allow { "allow-nrpe-v4": from => "${nagios_ip_v4}", ip => 'any', -- cgit v1.1 From 7242a1cf051cf6a73e47d9a9fb68ed6c6ae43778 Mon Sep 17 00:00:00 2001 From: Dennis Wallberg Date: Wed, 22 Apr 2015 16:14:24 +0200 Subject: added plugin --- global/overlay/etc/puppet/modules/sunet/manifests/nagios.pp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'global/overlay/etc/puppet/modules/sunet/manifests/nagios.pp') diff --git a/global/overlay/etc/puppet/modules/sunet/manifests/nagios.pp b/global/overlay/etc/puppet/modules/sunet/manifests/nagios.pp index cbd47a0..48bf5ca 100644 --- a/global/overlay/etc/puppet/modules/sunet/manifests/nagios.pp +++ b/global/overlay/etc/puppet/modules/sunet/manifests/nagios.pp @@ -6,12 +6,12 @@ class sunet::nagios { 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', @@ -19,27 +19,27 @@ class sunet::nagios { 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'), - } -> + } 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', -- cgit v1.1 From 0008d057cde159d7039c5f93fe69d5b9f7ee6bfb Mon Sep 17 00:00:00 2001 From: Dennis Wallberg Date: Wed, 22 Apr 2015 16:17:46 +0200 Subject: typo fixed --- global/overlay/etc/puppet/modules/sunet/manifests/nagios.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'global/overlay/etc/puppet/modules/sunet/manifests/nagios.pp') diff --git a/global/overlay/etc/puppet/modules/sunet/manifests/nagios.pp b/global/overlay/etc/puppet/modules/sunet/manifests/nagios.pp index 48bf5ca..91ccf6c 100644 --- a/global/overlay/etc/puppet/modules/sunet/manifests/nagios.pp +++ b/global/overlay/etc/puppet/modules/sunet/manifests/nagios.pp @@ -32,7 +32,7 @@ class sunet::nagios { mode => '0751', group => 'nagios', require => Package['nagios-nrpe-server'], - content => template('sunet/nagioshost/check_reboot'), + content => template('sunet/nagioshost/check_reboot.erb'), } ufw::allow { "allow-nrpe-v4": from => "${nagios_ip_v4}", -- cgit v1.1