Merge "Correctly cleanup self-monitoring sandboxes"

This commit is contained in:
Jenkins 2017-01-27 14:55:23 +00:00 committed by Gerrit Code Review
commit bca91e9b65
2 changed files with 23 additions and 20 deletions

View File

@ -118,24 +118,23 @@ define lma_collector::heka (
$heka_monitoring_ensure = absent
}
if $heka_monitoring {
heka::filter::sandbox { "heka_monitoring_${title}":
ensure => $heka_monitoring_ensure,
config_dir => $config_dir,
filename => "${lma_collector::params::plugins_dir}/filters/heka_monitoring.lua",
message_matcher => "Type == 'heka.all-report'",
require => ::Heka[$title],
module_directory => $lua_modules_dir,
notify => Class[$service_class],
}
heka::filter::sandbox { "heka_monitoring_${title}":
ensure => $heka_monitoring_ensure,
config_dir => $config_dir,
filename => "${lma_collector::params::plugins_dir}/filters/heka_monitoring.lua",
message_matcher => "Type == 'heka.all-report'",
require => ::Heka[$title],
module_directory => $lua_modules_dir,
notify => Class[$service_class],
}
# Dashboard is required to enable monitoring messages
heka::output::dashboard { "dashboard_${title}":
config_dir => $config_dir,
dashboard_address => $lma_collector::params::dashboard_address,
dashboard_port => $dashboard_port,
require => ::Heka[$title],
notify => Class[$service_class],
}
# Dashboard is required to enable monitoring messages
heka::output::dashboard { "dashboard_${title}":
ensure => $heka_monitoring_ensure,
config_dir => $config_dir,
dashboard_address => $lma_collector::params::dashboard_address,
dashboard_port => $dashboard_port,
require => ::Heka[$title],
notify => Class[$service_class],
}
}

View File

@ -67,8 +67,12 @@ describe 'lma_collector::heka' do
)
should contain_heka__input__tcp('metric')
should contain_heka__decoder__sandbox('metric' )
is_expected.to_not contain_heka__filter__sandbox('heka_monitoring_metric_collector')
is_expected.to_not contain_heka__output__dashboard('dashboard_metric_collector' )
should contain_heka__filter__sandbox('heka_monitoring_metric_collector').with(
'ensure' => 'absent'
)
should contain_heka__output__dashboard('dashboard_metric_collector' ).with(
'ensure' => 'absent'
)
}
end
end