Commit c592000d authored by Remi Hakim's avatar Remi Hakim

Let the agent set the default hostname

The hostname logic in the agent is more reliable

Defaulting to the node name can create some issues as the chef node
name can be based on the ip of the machine that could get recycled.
parent 77bcca85
......@@ -100,7 +100,7 @@ default['datadog']['check_freq'] = 15
# Specify agent hostname
# More information available here: http://docs.datadoghq.com/hostnames/#agent
default['datadog']['hostname'] = node.name
default['datadog']['hostname'] = nil
# If running on ec2, if true, use the instance-id as the host identifier
# rather than the hostname for chef-handler.
......
......@@ -4,7 +4,9 @@
dd_url: <%= @dd_url %>
api_key: <%= @api_key %>
check_freq: <%= node['datadog']['check_freq'] %>
<% if node['datadog']['hostname'] -%>
hostname: <%= node['datadog']['hostname'] %>
<% end -%>
use_mount: <%= node['datadog']['use_mount'] ? "yes" : "no" %>
listen_port: <%= node['datadog']['agent_port'] %>
bind_host: <%= node['datadog']['bind_host'] %>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment