Keep old monitor behavior for agent 5
MODIFY
resources/monitor.rb
resources/monitor.rb
@@ -16,7 +16,7 @@ property :logs, [Array, nil], required: false, default: []
action :add do
Chef::Log.debug("Adding monitoring for #{new_resource.name}")
- template ::File.join(config_file_path(new_resource.name), 'conf.yaml') do
+ template config_file_path(new_resource.name) do
# On Windows Agent v5, set the permissions on conf files to Administrators.
if node['platform_family'] == 'windows'
if node['datadog']['agent6']
@@ -59,8 +59,17 @@ end
def config_file_path(resource_name)
if node['datadog']['agent6']
- ::File.join(node['datadog']['agent6_config_dir'], 'conf.d', "#{resource_name}.d")
+ ::File.join(
+ node['datadog']['agent6_config_dir'],
+ 'conf.d',
+ "#{resource_name}.d",
+ 'conf.yaml'
+ )
else
- ::File.join(node['datadog']['config_dir'], 'conf.d', "#{resource_name}.d")
+ ::File.join(
+ node['datadog']['config_dir'],
+ 'conf.d',
+ "#{resource_name}.yaml"
+ )
end
end

Keep old monitor behavior for agent 5