init null value in kairodb_writer

in tsinghua cluster, there is one node of the 90 nodes cluster that
doesn't contain fqdn attribute, so set hostname or ipaddress as the
host id of a node.

Cherry-pick from Change-Id: I2d8b5956954ca481932d89a0512cee54475e966e

Conflicts:

	chef/cookbooks/collectd/recipes/kairosdb.rb

Change-Id: I9b4910b01ae323a1b109a701b0fd69bc73bb56b3
This commit is contained in:
Jerry Zhao 2014-11-13 05:29:48 -08:00
parent 4db535fd31
commit 116364c29a

View File

@ -28,6 +28,9 @@ end
if ! node['cluster']
node.set['cluster'] = "no_cluster_defined"
end
node.set['collectd']['client']['fqdn'] = node['fqdn'] || node['hostname'] || node['ipaddress'] || "fqdn_unknown"
collectd_python_plugin "kairosdb_writer" do
opts = {"KairosDBHost"=>node['collectd']['server']['host'],
"KairosDBPort"=>node['collectd']['server']['port'],