Change hostname in collectd.conf

- Add code to match collectd hostname to the system's hostname.
   - Add reno for this bug fix.

Change-Id: I4e4138addc979436de04200ffdedc5f440351116
Closes-Bug: #1680013
This commit is contained in:
Thaynara Silva 2017-04-12 08:07:56 +00:00
parent c85245b6f2
commit b0e2772f0a
2 changed files with 8 additions and 0 deletions

View File

@ -120,6 +120,10 @@ function adapt_collectd_conf {
sudo -E mkdir -p "$COLLECTD_CONF_DIR"
fi
# Configure collectd hostname
CONF_FILE=$(sudo find /etc -name "collectd.conf")
sudo sed -E -i 's|(^\|^#)Hostname.*$|Hostname "'$(hostname)'"|g' $CONF_FILE
# Configure collectd-ceilometer-plugin
if [[ "$COLLECTD_CEILOMETER_ENABLED" == "True" ]]; then
sudo cp $COLLECTD_CEILOMETER_DIR/etc/collectd.conf.d/collectd-ceilometer-plugin.conf $COLLECTD_CONF_DIR/

View File

@ -0,0 +1,4 @@
---
fixes:
- Fixes 'bug 1680013 https://bugs.launchpad.net/collectd-ceilometer-plugin/+bug/1680013'
Hostname in collectd is now set to match the system hostname.