summaryrefslogtreecommitdiff
path: root/puppet/modules
diff options
context:
space:
mode:
authorvarac <varacanero@zeromail.org>2014-02-07 15:42:46 +0100
committervarac <varacanero@zeromail.org>2014-02-07 15:42:46 +0100
commit65281c7d46a0ebbb7c70eddaef9802ddb1885c65 (patch)
treead4b73bb183f6c2d7851904ce21373ae87755120 /puppet/modules
parentd400d271e616f669cc6383a5893dd992a0efada2 (diff)
deploy check_mk on monitoring server
Diffstat (limited to 'puppet/modules')
-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';
}
+
}