diff --git a/devstack/libs/collectd b/devstack/libs/collectd index 5855385..544e143 100644 --- a/devstack/libs/collectd +++ b/devstack/libs/collectd @@ -46,6 +46,17 @@ sudo sed -i 's|CEILOMETER_TIMEOUT.*$|CEILOMETER_TIMEOUT "'$CEILOMETER_TIMEOUT'"| sudo sed -i 's|OS_PASSWORD.*$|OS_PASSWORD "'$SERVICE_PASSWORD'"|g' $COLLECTD_CONF_DIR/collectd-ceilometer-plugin.conf sudo sed -i 's|OS_TENANT_NAME.*$|OS_TENANT_NAME "'$SERVICE_TENANT_NAME'"|g' $COLLECTD_CONF_DIR/collectd-ceilometer-plugin.conf +# Configure custom units +if [[ "$COLLECTD_CEILOMETER_UNITS" != none ]]; then + OIFS=$IFS + IFS=',' + for UNIT in $COLLECTD_CEILOMETER_UNITS + do + sudo sed -i '//a\ UNIT '"$UNIT"'' $COLLECTD_CONF_DIR/collectd-ceilometer-plugin.conf + done + IFS=$OIFS +fi + # Configure collectd logfile plugin if [ -n $COLLECTD_LOG_FILE ]; then touch $COLLECTD_LOG_FILE diff --git a/devstack/settings b/devstack/settings index 91edeb2..61dcc07 100644 --- a/devstack/settings +++ b/devstack/settings @@ -26,3 +26,6 @@ if [ -z $COLLECTD_CONF_DIR ]; then COLLECTD_CONF_DIR=/etc/collectd.d fi fi + +#Custom units feature +COLLECTD_CEILOMETER_UNITS=${COLLECTD_CUSTOMIZE_UNITS:-none} diff --git a/doc/source/devstackGSG.rst b/doc/source/devstackGSG.rst index 390d599..66660c2 100644 --- a/doc/source/devstackGSG.rst +++ b/doc/source/devstackGSG.rst @@ -36,7 +36,10 @@ from the collectd-ceilometer-plugin repo into your devstack directory. Edit the "HOST_IP" varible to appropriately match your environment. -Build your devstack environment. +If you wish to enable any extra features please follow the instructions in the +"Additional Features" section below before moving on to the next step. + +Finally, build your devstack environment. | ./stack.sh @@ -52,3 +55,22 @@ this meter are being sent to ceilometer, thus confirming that collectd is working with ceilometer. | ceilometer sample-list --meter cpu.cpu + +Addtional Features +================== + +Custom Units Feature +-------------------- + +This feature enables users to define new units for existing meter values. +To enable this feature execute the following instructions: + +* To include your new units, add the following line with your chosen units to + your local.conf file. + +| COLLECTD_CEILOMETER_UNITS=" " + + If you would like to add more than one new unit include them in the same line + and seperate each meter and its unit with a comma, as shown below. + +| COLLECTD_CEILOMETER_UNITS=" , " \ No newline at end of file diff --git a/doc/source/usage.rst b/doc/source/usage.rst index 45174bc..ef463e4 100644 --- a/doc/source/usage.rst +++ b/doc/source/usage.rst @@ -60,6 +60,14 @@ COLLECTD_LOG_LEVEL this are going to be filtered out from the log file. Default: info + +COLLECTD_CEILOMETER_UNITS + (meter=unit) a comma seperated list of pairs, defining meters and their units. + Allows existing units to be changed and new units to be set for new meters. + + Example: COLLECTD_CEILOMETER_UNITS=" , " + + Authenticating using Identity Server API v3 =========================================== diff --git a/etc/collectd.conf.d/collectd-ceilometer-plugin.conf b/etc/collectd.conf.d/collectd-ceilometer-plugin.conf index 8ae5a07..e83f1cc 100644 --- a/etc/collectd.conf.d/collectd-ceilometer-plugin.conf +++ b/etc/collectd.conf.d/collectd-ceilometer-plugin.conf @@ -30,5 +30,7 @@ OS_PASSWORD "password" OS_TENANT_NAME "service" + + diff --git a/releasenotes/notes/devstack-units-feature-b0db37e81a854676.yaml b/releasenotes/notes/devstack-units-feature-b0db37e81a854676.yaml new file mode 100644 index 0000000..7e92f14 --- /dev/null +++ b/releasenotes/notes/devstack-units-feature-b0db37e81a854676.yaml @@ -0,0 +1,9 @@ +--- +features: + - Enabled the pre-existing custom units feature for DevStack + deployment. You can now customize the units of existing meters + before DevStack is deployed. This can be done for multiple + units at a time. +other: + - Updated the devstackGSG.rst guide to provide instructions on + how to enable the custom units feature before DevStack is deployed.