Use cluster_id from the chef attribute
Change-Id: Icbdfc6b7185725efbf8e57d5005395912ba6b413
This commit is contained in:
parent
353ee09bde
commit
2e40ce9f72
@ -25,16 +25,17 @@ cookbook_file "#{node['collectd']['plugin_dir']}/kairosdb_writer.py" do
|
||||
notifies :restart, resources(:service => "collectd")
|
||||
end
|
||||
|
||||
if ! node['cluster']
|
||||
node.set['cluster'] = "no_cluster_defined"
|
||||
cluster_id = 'no_cluster_defined'
|
||||
if node['compass'] and node['compass']['cluster_id']
|
||||
cluster_id = node['compass']['cluster_id']
|
||||
end
|
||||
|
||||
collectd_python_plugin "kairosdb_writer" do
|
||||
opts = {"KairosDBHost"=>node['collectd']['server']['host'],
|
||||
"KairosDBPort"=>node['collectd']['server']['port'],
|
||||
"KairosDBProtocol"=>node['collectd']['server']['protocol'],
|
||||
"Tags" => "host=#{node['fqdn']}\" \"role=OSROLE\" \"location=China.Beijing.TsingHua\" \"cluster=#{node['cluster']}",
|
||||
"Tags" => "host=#{node['fqdn']}\" \"role=OSROLE\" \"location=China.Beijing.TsingHua\" \"cluster=#{cluster_id}",
|
||||
"TypesDB" => node['collectd']['types_db'],
|
||||
"LowercaseMetricNames"=>"true"
|
||||
}
|
||||
options(opts)
|
||||
end
|
||||
|
Loading…
x
Reference in New Issue
Block a user