From c1a19aa347fb8a68840043e86d80f7124e638f87 Mon Sep 17 00:00:00 2001 From: Bryan Sullivan Date: Mon, 27 Nov 2017 21:23:13 -0800 Subject: Add loglevel as env variable JIRA: VES-2 Change-Id: I909da7f9bc62ba33e5e33bb90d153ec9a425acb8 Signed-off-by: Bryan Sullivan --- tools/ves-setup.sh | 44 ++++++++++++++++++++++++++++---------------- 1 file changed, 28 insertions(+), 16 deletions(-) (limited to 'tools/ves-setup.sh') diff --git a/tools/ves-setup.sh b/tools/ves-setup.sh index 027b440..a39ce6c 100644 --- a/tools/ves-setup.sh +++ b/tools/ves-setup.sh @@ -50,6 +50,8 @@ #. ves_influxdb_auth: credentials in form "user/pass" (default: none) #. ves_grafana_host: grafana host:port (default: none) #. ves_grafana_auth: credentials in form "user/pass" (default: admin/admin) +#. ves_loglevel: loglevel for VES Agent and Collector (ERROR|DEBUG) +#. ves_cloudtype: kubernetes|openstack (default:kubernetes) #. #. Usage: #. git clone https://gerrit.opnfv.org/gerrit/ves /tmp/ves @@ -118,6 +120,8 @@ ves_influxdb_host="${ves_influxdb_host:=localhost:8086}" ves_influxdb_auth="${ves_influxdb_auth:=}" ves_grafana_host="${ves_grafana_host:=localhost:3000}" ves_grafana_auth="${ves_grafana_auth:=admin:admin}" +ves_loglevel="${ves_loglevel:=}" +ves_cloudtype="${ves_cloudtype:=kubernetes}" export ves_mode export ves_host export ves_port @@ -134,6 +138,8 @@ export ves_influxdb_host export ves_influxdb_auth export ves_grafana_host export ves_grafana_auth +export ves_loglevel +export ves_cloudtype EOF source /tmp/ves/ves_env.sh @@ -229,11 +235,6 @@ function setup_collectd() { sudo apt-get install -y libxml2-dev libpciaccess-dev libyajl-dev \ libdevmapper-dev - log "start libvirtd" - # TODO: install libvirt from source to enable all features per - # http://docs.opnfv.org/en/latest/submodules/barometer/docs/release/userguide/feature.userguide.html#virt-plugin - sudo systemctl start libvirtd - # # TODO: fix for journalctl -xe report "... is marked executable" # sudo chmod 744 /etc/systemd/system/collectd.service @@ -253,16 +254,6 @@ LoadPlugin csv StoreRates false -# TODO: complete the virt plugin install before enabling -#LoadPlugin virt -# -# Connection "qemu:///system" -# RefreshInterval 60 -# HostnameFormat uuid -# PluginInstanceFormat name -# ExtraStats "cpu_util" -# - LoadPlugin target_set LoadPlugin match_regex @@ -298,6 +289,24 @@ LoadPlugin write_kafka EOF + + if [[ "$ves_cloudtype" == "openstack" ]]; then + log "start libvirtd" + # TODO: install libvirt from source to enable all features per + # http://docs.opnfv.org/en/latest/submodules/barometer/docs/release/userguide/feature.userguide.html#virt-plugin + # sudo systemctl start libvirtd + + cat < + Connection "qemu:///system" + RefreshInterval 60 + HostnameFormat uuid + PluginInstanceFormat name + ExtraStats "cpu_util" + +EOF + fi else cat <