summaryrefslogtreecommitdiff
path: root/puppet/modules/site_nagios/manifests
diff options
context:
space:
mode:
Diffstat (limited to 'puppet/modules/site_nagios/manifests')
-rw-r--r--puppet/modules/site_nagios/manifests/server.pp3
-rw-r--r--puppet/modules/site_nagios/manifests/server/check_mk.pp48
2 files changed, 35 insertions, 16 deletions
diff --git a/puppet/modules/site_nagios/manifests/server.pp b/puppet/modules/site_nagios/manifests/server.pp
index 6ade7d06..59a3bbb0 100644
--- a/puppet/modules/site_nagios/manifests/server.pp
+++ b/puppet/modules/site_nagios/manifests/server.pp
@@ -51,6 +51,7 @@ class site_nagios::server inherits nagios::base {
create_resources ( site_nagios::add_host, $hosts )
- include site_nagios::apache
+ include site_nagios::server::apache
+ include site_nagios::server::check_mk
include site_shorewall::monitor
}
diff --git a/puppet/modules/site_nagios/manifests/server/check_mk.pp b/puppet/modules/site_nagios/manifests/server/check_mk.pp
index c6676d76..75bd4538 100644
--- a/puppet/modules/site_nagios/manifests/server/check_mk.pp
+++ b/puppet/modules/site_nagios/manifests/server/check_mk.pp
@@ -1,24 +1,42 @@
class site_nagios::server::check_mk {
+ $ssh_hash = hiera('ssh')
+ $pubkey = $ssh_hash['authorized_keys']['monitor']['key']
+ $type = $ssh_hash['authorized_keys']['monitor']['type']
+ $seckey = $ssh_hash['monitor']['private_key']
+ $all_hosts = '"localhost", "plain1"'
+
+ package { 'check-mk-server':
+ ensure => installed,
+ }
+
# override paths to use the system check_mk rather than OMD
class { 'check_mk::config':
- site => '',
- etc_dir => '/etc',
- bin_dir => '/usr/bin',
- host_groups => undef
+ site => '',
+ etc_dir => '/etc',
+ nagios_subdir => 'nagios3',
+ bin_dir => '/usr/bin',
+ host_groups => undef,
+ require => Package['check-mk-server']
}
file {
- '/etc/nagios/check_mk':
- ensure => directory,
- owner => root,
- group => root,
- mode => '0755';
-
- '/etc/nagios/check_mk/.ssh':
- ensure => directory,
- owner => root,
- group => root,
- mode => '0755';
+ '/etc/check_mk/conf.d/use_ssh.mk':
+ source => 'puppet:///modules/site_check_mk/use_ssh.mk',
+ notify => Exec['check_mk-refresh'];
+ '/etc/check_mk/all_hosts_static':
+ content => $all_hosts,
+ notify => Exec['check_mk-refresh'];
+ '/etc/check_mk/.ssh':
+ ensure => directory;
+ '/etc/check_mk/.ssh/id_rsa':
+ content => $seckey,
+ owner => 'nagios',
+ mode => '0600';
+ '/etc/check_mk/.ssh/id_rsa.pub':
+ content => "${type} ${pubkey} monitor",
+ owner => 'nagios',
+ mode => '0644';
}
+
}