summaryrefslogtreecommitdiff
path: root/example/site_check_mk/manifests/agent
diff options
context:
space:
mode:
Diffstat (limited to 'example/site_check_mk/manifests/agent')
-rw-r--r--example/site_check_mk/manifests/agent/apt.pp25
-rw-r--r--example/site_check_mk/manifests/agent/logwatch.pp36
-rw-r--r--example/site_check_mk/manifests/agent/logwatch/syslog.pp18
3 files changed, 79 insertions, 0 deletions
diff --git a/example/site_check_mk/manifests/agent/apt.pp b/example/site_check_mk/manifests/agent/apt.pp
new file mode 100644
index 0000000..a74a906
--- /dev/null
+++ b/example/site_check_mk/manifests/agent/apt.pp
@@ -0,0 +1,25 @@
+class site_check_mk::agent::apt {
+ include check_mk::agent::mrpe
+
+
+ # we deliver a wrapper to check_apt that makes it more useful
+ augeas {
+ "Apt":
+ incl => '/etc/check_mk/mrpe.cfg',
+ lens => 'Spacevars.lns',
+ changes => 'set APT "/usr/local/lib/nagios/plugins/check_apt -t 30"',
+ require => [ File['/usr/local/lib/nagios/plugins' ], Package['check-mk-agent'] ];
+ }
+
+ # installing a local plugin, so include this to get the dirs
+ include site_nagios::localplugin
+
+ file {
+ '/usr/local/lib/nagios/plugins/check_apt':
+ source => 'puppet:///modules/site_check_mk/agent/apt/check_apt',
+ owner => root,
+ group => root,
+ mode => '0750',
+ require => [ File['/usr/local/lib/nagios/plugins' ], Package['nagios-plugins-basic'] ];
+ }
+}
diff --git a/example/site_check_mk/manifests/agent/logwatch.pp b/example/site_check_mk/manifests/agent/logwatch.pp
new file mode 100644
index 0000000..423cace
--- /dev/null
+++ b/example/site_check_mk/manifests/agent/logwatch.pp
@@ -0,0 +1,36 @@
+class site_check_mk::agent::logwatch {
+ # Deploy mk_logwatch 1.2.4 so we can split the config
+ # into multiple config files in /etc/check_mk/logwatch.d
+ # see https://leap.se/code/issues/5135
+
+ file { '/usr/lib/check_mk_agent/plugins/mk_logwatch':
+ source => 'puppet:///modules/site_check_mk/agent/plugins/mk_logwatch.1.2.4',
+ mode => '0755',
+ require => Package['check-mk-agent-logwatch']
+ }
+
+ # only config files that watch a distinct logfile should go in logwatch.d/
+ file { '/etc/check_mk/logwatch.d':
+ ensure => directory,
+ recurse => true,
+ purge => true,
+ require => Package['check-mk-agent-logwatch']
+ }
+
+ # 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/example/site_check_mk/manifests/agent/logwatch/syslog.pp b/example/site_check_mk/manifests/agent/logwatch/syslog.pp
new file mode 100644
index 0000000..c927780
--- /dev/null
+++ b/example/site_check_mk/manifests/agent/logwatch/syslog.pp
@@ -0,0 +1,18 @@
+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_header.cfg',
+ target => '/etc/check_mk/logwatch.d/syslog.cfg',
+ order => '01';
+ }
+ concat::fragment { 'syslog_tail':
+ source => 'puppet:///modules/site_check_mk/agent/logwatch/syslog_tail.cfg',
+ target => '/etc/check_mk/logwatch.d/syslog.cfg',
+ order => '99';
+ }
+
+}