summaryrefslogtreecommitdiff
path: root/puppet/modules/site_check_mk/manifests/agent
diff options
context:
space:
mode:
authorvarac <varacanero@zeromail.org>2014-02-20 17:07:48 +0100
committervarac <varacanero@zeromail.org>2014-02-25 13:15:53 +0100
commitc0d0a5a0af891c360dded0c508591cf50899bc66 (patch)
tree56445e28845bf19a3abdda001c570cb3bb427f3f /puppet/modules/site_check_mk/manifests/agent
parent59440389ebc20bdd5e0e53fbeaaaab40e01c6fd5 (diff)
now using concanated check_mk logwatch files where needed (#5155)
Diffstat (limited to 'puppet/modules/site_check_mk/manifests/agent')
-rw-r--r--puppet/modules/site_check_mk/manifests/agent/logwatch.pp21
-rw-r--r--puppet/modules/site_check_mk/manifests/agent/logwatch/syslog.pp13
-rw-r--r--puppet/modules/site_check_mk/manifests/agent/tapicero.pp6
3 files changed, 37 insertions, 3 deletions
diff --git a/puppet/modules/site_check_mk/manifests/agent/logwatch.pp b/puppet/modules/site_check_mk/manifests/agent/logwatch.pp
index 67db5a12..38514af2 100644
--- a/puppet/modules/site_check_mk/manifests/agent/logwatch.pp
+++ b/puppet/modules/site_check_mk/manifests/agent/logwatch.pp
@@ -8,8 +8,27 @@ class site_check_mk::agent::logwatch {
mode => '0755'
}
+ # only config files that watch a distinct logfile should go in logwatch.d/
file { '/etc/check_mk/logwatch.d':
- ensure => directory
+ ensure => directory,
+ recurse => true,
+ purge => true,
}
+ # service that share a common logfile (i.e. /var/log/syslog) need to get
+ # concanated in one file, otherwise the last file sourced will override
+ # the config before
+ # see mk_logwatch: "logwatch.cfg overwrites config files in logwatch.d",
+ # https://leap.se/code/issues/5155
+
+ # first, we need to deploy a custom logwatch.cfg that doesn't include
+ # a section about /var/log/syslog
+
+ file { '/etc/check_mk/logwatch.cfg':
+ source => 'puppet:///modules/site_check_mk/agent/logwatch/logwatch.cfg',
+ require => Package['check_mk-agent-logwatch']
+ }
+
+ include concat::setup
+ include site_check_mk::agent::logwatch::syslog
}
diff --git a/puppet/modules/site_check_mk/manifests/agent/logwatch/syslog.pp b/puppet/modules/site_check_mk/manifests/agent/logwatch/syslog.pp
new file mode 100644
index 00000000..ac3dda64
--- /dev/null
+++ b/puppet/modules/site_check_mk/manifests/agent/logwatch/syslog.pp
@@ -0,0 +1,13 @@
+class site_check_mk::agent::logwatch::syslog {
+
+ concat { '/etc/check_mk/logwatch.d/syslog.cfg':
+ warn => true
+ }
+
+ concat::fragment { 'syslog_header':
+ source => 'puppet:///modules/site_check_mk/agent/logwatch/syslog.cfg',
+ target => '/etc/check_mk/logwatch.d/syslog.cfg',
+ order => '01';
+ }
+
+}
diff --git a/puppet/modules/site_check_mk/manifests/agent/tapicero.pp b/puppet/modules/site_check_mk/manifests/agent/tapicero.pp
index 088900f4..dc785e52 100644
--- a/puppet/modules/site_check_mk/manifests/agent/tapicero.pp
+++ b/puppet/modules/site_check_mk/manifests/agent/tapicero.pp
@@ -1,7 +1,9 @@
class site_check_mk::agent::tapicero {
- file { '/etc/check_mk/logwatch.d/tapicero.cfg':
- source => 'puppet:///modules/site_check_mk/agent/logwatch/tapicero.cfg',
+ concat::fragment { 'syslog_tapicero':
+ source => 'puppet:///modules/site_check_mk/agent/logwatch/tapicero.cfg',
+ target => '/etc/check_mk/logwatch.d/syslog.cfg',
+ order => '02';
}
# local nagios plugin checks via mrpe