From 116364c29a96278c68657bcb0f1988c7709a2255 Mon Sep 17 00:00:00 2001 From: Jerry Zhao Date: Thu, 13 Nov 2014 05:29:48 -0800 Subject: [PATCH] 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 --- chef/cookbooks/collectd/recipes/kairosdb.rb | 3 +++ 1 file changed, 3 insertions(+) diff --git a/chef/cookbooks/collectd/recipes/kairosdb.rb b/chef/cookbooks/collectd/recipes/kairosdb.rb index c2b9fcd..e6f650a 100644 --- a/chef/cookbooks/collectd/recipes/kairosdb.rb +++ b/chef/cookbooks/collectd/recipes/kairosdb.rb @@ -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'],