From 0c916d8e70bdb6165fe25d6f4e3ceadb1c0622a0 Mon Sep 17 00:00:00 2001 From: varac Date: Tue, 10 Mar 2015 22:51:31 +0100 Subject: Use augeas instead of file_line to configure entries in /etc/check_mk/mrpe.cfg (Bug #6788) We used file_line before, but when the some check parameters change, a new line would be added, leaving the old line there, resulting in two checks with the same name but with different parameters. Augeas can handle this better, but it is important to use 'rm' to remove all old lines with different parameters before adding the new line. Change-Id: Iad69dfd20f487a16d372a4f4a4bc53299f9e4a66 --- puppet/modules/site_check_mk/manifests/agent/tapicero.pp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'puppet/modules/site_check_mk/manifests/agent/tapicero.pp') diff --git a/puppet/modules/site_check_mk/manifests/agent/tapicero.pp b/puppet/modules/site_check_mk/manifests/agent/tapicero.pp index ffd11100..39651567 100644 --- a/puppet/modules/site_check_mk/manifests/agent/tapicero.pp +++ b/puppet/modules/site_check_mk/manifests/agent/tapicero.pp @@ -9,14 +9,16 @@ class site_check_mk::agent::tapicero { } # local nagios plugin checks via mrpe - file_line { + augeas { 'Tapicero_Procs': - line => 'Tapicero_Procs /usr/lib/nagios/plugins/check_procs -w 1:1 -c 1:1 -a tapicero', - path => '/etc/check_mk/mrpe.cfg'; - + incl => '/etc/check_mk/mrpe.cfg', + lens => 'Spacevars.lns', + changes => [ + 'rm /files/etc/check_mk/mrpe.cfg/Tapicero_Procs', + 'set Tapicero_Procs "/usr/lib/nagios/plugins/check_procs -w 1:1 -c 1:1 -a tapicero"' ]; 'Tapicero_Heartbeat': - line => 'Tapicero_Heartbeat /usr/local/lib/nagios/plugins/check_last_regex_in_log -f /var/log/syslog -r "tapicero" -w 300 -c 600', - path => '/etc/check_mk/mrpe.cfg'; + incl => '/etc/check_mk/mrpe.cfg', + lens => 'Spacevars.lns', + changes => 'set Tapicero_Heartbeat \'/usr/local/lib/nagios/plugins/check_last_regex_in_log -f /var/log/syslog -r "tapicero" -w 300 -c 600\''; } - } -- cgit v1.2.3 From 6d4dcb83118e3d88aed49347690babd69eb56c91 Mon Sep 17 00:00:00 2001 From: varac Date: Thu, 12 Mar 2015 11:30:47 +0100 Subject: require file for augeas resources in site_check_mk::agent::* Change-Id: Ia5ac6f50e023d7d358d17c661b71c6a5880ec445 --- puppet/modules/site_check_mk/manifests/agent/tapicero.pp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'puppet/modules/site_check_mk/manifests/agent/tapicero.pp') diff --git a/puppet/modules/site_check_mk/manifests/agent/tapicero.pp b/puppet/modules/site_check_mk/manifests/agent/tapicero.pp index 39651567..5c14b460 100644 --- a/puppet/modules/site_check_mk/manifests/agent/tapicero.pp +++ b/puppet/modules/site_check_mk/manifests/agent/tapicero.pp @@ -15,10 +15,12 @@ class site_check_mk::agent::tapicero { lens => 'Spacevars.lns', changes => [ 'rm /files/etc/check_mk/mrpe.cfg/Tapicero_Procs', - 'set Tapicero_Procs "/usr/lib/nagios/plugins/check_procs -w 1:1 -c 1:1 -a tapicero"' ]; + 'set Tapicero_Procs "/usr/lib/nagios/plugins/check_procs -w 1:1 -c 1:1 -a tapicero"' ], + require => File['/etc/check_mk/mrpe.cfg']; 'Tapicero_Heartbeat': incl => '/etc/check_mk/mrpe.cfg', lens => 'Spacevars.lns', - changes => 'set Tapicero_Heartbeat \'/usr/local/lib/nagios/plugins/check_last_regex_in_log -f /var/log/syslog -r "tapicero" -w 300 -c 600\''; + changes => 'set Tapicero_Heartbeat \'/usr/local/lib/nagios/plugins/check_last_regex_in_log -f /var/log/syslog -r "tapicero" -w 300 -c 600\'', + require => File['/etc/check_mk/mrpe.cfg']; } } -- cgit v1.2.3 From 7f069dc47c318e9047a3ae7a29a90f3471610e34 Mon Sep 17 00:00:00 2001 From: elijah Date: Wed, 15 Apr 2015 09:36:30 -0700 Subject: fix tapicero & webapp logs: remove heartbeat log check, move to /var/log/tapicero, fix webapp logwatch location. --- puppet/modules/site_check_mk/manifests/agent/tapicero.pp | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) (limited to 'puppet/modules/site_check_mk/manifests/agent/tapicero.pp') diff --git a/puppet/modules/site_check_mk/manifests/agent/tapicero.pp b/puppet/modules/site_check_mk/manifests/agent/tapicero.pp index 5c14b460..9bdebe2a 100644 --- a/puppet/modules/site_check_mk/manifests/agent/tapicero.pp +++ b/puppet/modules/site_check_mk/manifests/agent/tapicero.pp @@ -2,10 +2,9 @@ class site_check_mk::agent::tapicero { include ::site_nagios::plugins - concat::fragment { 'syslog_tapicero': - source => 'puppet:///modules/site_check_mk/agent/logwatch/syslog/tapicero.cfg', - target => '/etc/check_mk/logwatch.d/syslog.cfg', - order => '02'; + # watch logs + file { '/etc/check_mk/logwatch.d/tapicero.cfg': + source => 'puppet:///modules/site_check_mk/agent/logwatch/tapicero.cfg', } # local nagios plugin checks via mrpe @@ -17,10 +16,5 @@ class site_check_mk::agent::tapicero { 'rm /files/etc/check_mk/mrpe.cfg/Tapicero_Procs', 'set Tapicero_Procs "/usr/lib/nagios/plugins/check_procs -w 1:1 -c 1:1 -a tapicero"' ], require => File['/etc/check_mk/mrpe.cfg']; - 'Tapicero_Heartbeat': - incl => '/etc/check_mk/mrpe.cfg', - lens => 'Spacevars.lns', - changes => 'set Tapicero_Heartbeat \'/usr/local/lib/nagios/plugins/check_last_regex_in_log -f /var/log/syslog -r "tapicero" -w 300 -c 600\'', - require => File['/etc/check_mk/mrpe.cfg']; } } -- cgit v1.2.3 From 43fb605eebadb18abc62abb5a2fb5bbce41d0334 Mon Sep 17 00:00:00 2001 From: elijah Date: Wed, 15 Apr 2015 16:22:16 -0700 Subject: restore tapicero heartbeat. --- puppet/modules/site_check_mk/manifests/agent/tapicero.pp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'puppet/modules/site_check_mk/manifests/agent/tapicero.pp') diff --git a/puppet/modules/site_check_mk/manifests/agent/tapicero.pp b/puppet/modules/site_check_mk/manifests/agent/tapicero.pp index 9bdebe2a..4a5ec68e 100644 --- a/puppet/modules/site_check_mk/manifests/agent/tapicero.pp +++ b/puppet/modules/site_check_mk/manifests/agent/tapicero.pp @@ -16,5 +16,10 @@ class site_check_mk::agent::tapicero { 'rm /files/etc/check_mk/mrpe.cfg/Tapicero_Procs', 'set Tapicero_Procs "/usr/lib/nagios/plugins/check_procs -w 1:1 -c 1:1 -a tapicero"' ], require => File['/etc/check_mk/mrpe.cfg']; + 'Tapicero_Heartbeat': + incl => '/etc/check_mk/mrpe.cfg', + lens => 'Spacevars.lns', + changes => 'set Tapicero_Heartbeat \'/usr/local/lib/nagios/plugins/check_last_regex_in_log -f /var/log/leap/tapicero.log -r "tapicero" -w 300 -c 600\'', + require => File['/etc/check_mk/mrpe.cfg']; } } -- cgit v1.2.3