summaryrefslogtreecommitdiff
path: root/global/overlay/etc/puppet
diff options
context:
space:
mode:
authorDennis Wallberg <dennis@nordu.net>2015-04-22 14:58:29 +0200
committerDennis Wallberg <dennis@nordu.net>2015-04-22 14:58:29 +0200
commit9a6c9b342db6b00f2786edca1d974540a766b1cf (patch)
treeaf85265c70ab6e5c6faa83d9924f4782df1c23fd /global/overlay/etc/puppet
parent0a61b4512b9492da2f869a3950a8d3a824556fd1 (diff)
nagios configuration update
Diffstat (limited to 'global/overlay/etc/puppet')
-rw-r--r--global/overlay/etc/puppet/manifests/cosmos-site.pp37
-rw-r--r--global/overlay/etc/puppet/modules/sunet/manifests/nagios.pp34
2 files changed, 35 insertions, 36 deletions
diff --git a/global/overlay/etc/puppet/manifests/cosmos-site.pp b/global/overlay/etc/puppet/manifests/cosmos-site.pp
index 480eacf..c7bc59c 100644
--- a/global/overlay/etc/puppet/manifests/cosmos-site.pp
+++ b/global/overlay/etc/puppet/manifests/cosmos-site.pp
@@ -50,41 +50,6 @@ class mailclient ($domain) {
cosmos::preseed::preseed_package {"postfix": ensure => present, domain => $domain}
}
-class nagioshost {
-
- $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',
- } ->
- 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
- }
-}
-
node 'sto-tug-kvm1.swamid.se' {
package {'python-vm-builder':
@@ -163,7 +128,7 @@ node 'datasets.sunet.se' {
}
node 'docker.sunet.se' {
- class { 'nagioshost': }
+ class { 'sunet::nagios': }
docker::image {'registry': }
docker::image {'leifj/pound': }
docker::run {'sunetregistry':
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
+ }
}