From 13338ce6fb31a3432e896bbb5be6ac8780a6e541 Mon Sep 17 00:00:00 2001 From: Bryan Sullivan Date: Mon, 20 Nov 2017 18:04:15 -0800 Subject: Improve dashboard. Update to merged VES Agent design. JIRA: VES-2 Change-Id: I897472b3d753dd1e471536c57cff88ab525bf9c8 Signed-off-by: Bryan Sullivan --- tools/grafana/Dashboard.json | 342 +++++++++++-------------------------------- tools/ves-setup.sh | 83 ++++++++++- 2 files changed, 163 insertions(+), 262 deletions(-) (limited to 'tools') diff --git a/tools/grafana/Dashboard.json b/tools/grafana/Dashboard.json index d59e5da..3160296 100644 --- a/tools/grafana/Dashboard.json +++ b/tools/grafana/Dashboard.json @@ -1,5 +1,6 @@ { "dashboard": { + "description": "This Dashboard provides a general overview of a host, with templating to select the hostname.", "editable": true, "gnetId": null, "graphTooltip": 0, @@ -55,36 +56,7 @@ "steppedLine": false, "targets": [ { - "alias": "CpuUser", - "dsType": "influxdb", - "groupBy": [ - { - "params": [ - "system" - ], - "type": "tag" - } - ], - "measurement": "load", - "orderByTime": "ASC", - "policy": "default", - "query": "SELECT mean(\"cpuuser\") FROM \"cpu\" WHERE \"system\" = 'computehost' AND $timeFilter GROUP BY time(1m) fill(null)", - "refId": "A", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "load-longterm" - ], - "type": "field" - } - ] - ], - "tags": [] - }, - { - "alias": "CpuSystem", + "alias": "", "dsType": "influxdb", "groupBy": [ { @@ -113,43 +85,8 @@ "tags": [ { "key": "system", - "operator": "=", - "value": "OPNFV01" - } - ] - }, - { - "alias": "CpuIdle", - "dsType": "influxdb", - "groupBy": [ - { - "params": [ - "system" - ], - "type": "tag" - } - ], - "measurement": "load", - "orderByTime": "ASC", - "policy": "default", - "query": "SELECT mean(\"cpuidle\") FROM \"cpu\" WHERE $timeFilter GROUP BY time(1m) fill(null)", - "refId": "C", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "load-midterm" - ], - "type": "field" - } - ] - ], - "tags": [ - { - "key": "system", - "operator": "=", - "value": "OPNFV01" + "operator": "=~", + "value": "/^$host$/" } ] } @@ -228,7 +165,7 @@ "steppedLine": false, "targets": [ { - "alias": "Free", + "alias": "", "dsType": "influxdb", "groupBy": [ { @@ -253,147 +190,13 @@ } ] ], - "tags": [] - }, - { - "alias": "Used", - "dsType": "influxdb", - "groupBy": [ - { - "params": [ - "system" - ], - "type": "tag" - } - ], - "measurement": "memoryUsage", - "orderByTime": "ASC", - "policy": "autogen", - "refId": "B", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "memoryUsed" - ], - "type": "field" - } - ] - ], - "tags": [] - }, - { - "alias": "Buffered", - "dsType": "influxdb", - "groupBy": [ - { - "params": [ - "system" - ], - "type": "tag" - } - ], - "measurement": "memoryUsage", - "orderByTime": "ASC", - "policy": "autogen", - "refId": "C", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "memoryBuffered" - ], - "type": "field" - } - ] - ], - "tags": [] - }, - { - "alias": "Cached", - "dsType": "influxdb", - "groupBy": [ - { - "params": [ - "system" - ], - "type": "tag" - } - ], - "measurement": "memoryUsage", - "orderByTime": "ASC", - "policy": "autogen", - "refId": "D", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "memoryCached" - ], - "type": "field" - } - ] - ], - "tags": [] - }, - { - "alias": "SlabRecl", - "dsType": "influxdb", - "groupBy": [ - { - "params": [ - "system" - ], - "type": "tag" - } - ], - "measurement": "memoryUsage", - "orderByTime": "ASC", - "policy": "autogen", - "refId": "E", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "memorySlabRecl" - ], - "type": "field" - } - ] - ], - "tags": [] - }, - { - "alias": "SlabUnrecl", - "dsType": "influxdb", - "groupBy": [ + "tags": [ { - "params": [ - "system" - ], - "type": "tag" + "key": "system", + "operator": "=~", + "value": "/^$host$/" } - ], - "measurement": "memoryUsage", - "orderByTime": "ASC", - "policy": "autogen", - "refId": "F", - "resultFormat": "time_series", - "select": [ - [ - { - "params": [ - "memorySlabUnrecl" - ], - "type": "field" - } - ] - ], - "tags": [] + ] } ], "thresholds": [], @@ -442,43 +245,9 @@ }, { "collapse": false, - "height": 250, + "height": 433, "panels": [ { - "alert": { - "conditions": [ - { - "evaluator": { - "params": [ - 15000000 - ], - "type": "gt" - }, - "operator": { - "type": "and" - }, - "query": { - "params": [ - "A", - "1s", - "now" - ] - }, - "reducer": { - "params": [], - "type": "avg" - }, - "type": "query" - } - ], - "executionErrorState": "alerting", - "frequency": "1s", - "handler": 1, - "message": "Transmitted Traffic Exceeded limits\nClosed Loop Action:Apply Firewall Rules", - "name": "VES webserver_1 Network Usage alert", - "noDataState": "no_data", - "notifications": [] - }, "aliasColors": {}, "bars": false, "dashLength": 10, @@ -496,7 +265,7 @@ "id": 2, "interval": "30s", "legend": { - "alignAsTable": false, + "alignAsTable": true, "avg": true, "current": false, "max": false, @@ -521,7 +290,7 @@ "steppedLine": false, "targets": [ { - "alias": "rxOctets", + "alias": "", "dsType": "influxdb", "groupBy": [ { @@ -547,13 +316,19 @@ [ { "params": [ - "receivedOctetsAccumulated" + "receivedTotalPacketsAccumulated" ], "type": "field" } ] ], - "tags": [] + "tags": [ + { + "key": "system", + "operator": "=~", + "value": "/^$host$/" + } + ] } ], "thresholds": [], @@ -562,7 +337,7 @@ "title": "Received Octets", "tooltip": { "shared": true, - "sort": 0, + "sort": 2, "value_type": "individual" }, "type": "graph", @@ -616,7 +391,7 @@ "id": 4, "interval": "30s", "legend": { - "alignAsTable": false, + "alignAsTable": true, "avg": true, "current": false, "max": false, @@ -641,7 +416,7 @@ "steppedLine": false, "targets": [ { - "alias": "txOctets", + "alias": "", "dsType": "influxdb", "groupBy": [ { @@ -666,13 +441,19 @@ [ { "params": [ - "transmittedOctetsAccumulated" + "receivedOctetsAccumulated" ], "type": "field" } ] ], - "tags": [] + "tags": [ + { + "key": "system", + "operator": "=~", + "value": "/^$host$/" + } + ] } ], "thresholds": [], @@ -681,7 +462,7 @@ "title": "Transmitted Octets", "tooltip": { "shared": true, - "sort": 0, + "sort": 2, "value_type": "individual" }, "type": "graph", @@ -730,7 +511,60 @@ "style": "dark", "tags": [], "templating": { - "list": [] + "list": [ + { + "allValue": null, + "current": { + "tags": [], + "text": "All", + "value": [ + "$__all" + ] + }, + "datasource": "VESEvents", + "hide": 0, + "includeAll": true, + "label": "host", + "multi": true, + "name": "host", + "options": [ + { + "selected": true, + "text": "All", + "value": "$__all" + }, + { + "selected": false, + "text": "4C4C4544-004C-4E10-8054-B6C04F475831", + "value": "4C4C4544-004C-4E10-8054-B6C04F475831" + }, + { + "selected": false, + "text": "4C4C4544-004C-4E10-8057-B6C04F475831", + "value": "4C4C4544-004C-4E10-8057-B6C04F475831" + }, + { + "selected": false, + "text": "4C4C4544-004C-5010-8053-B6C04F475831", + "value": "4C4C4544-004C-5010-8053-B6C04F475831" + }, + { + "selected": false, + "text": "4C4C4544-004E-3110-8051-C3C04F445631", + "value": "4C4C4544-004E-3110-8051-C3C04F445631" + } + ], + "query": "SHOW TAG VALUES WITH KEY=system", + "refresh": 0, + "regex": "", + "sort": 0, + "tagValuesQuery": "", + "tags": [], + "tagsQuery": "", + "type": "query", + "useTags": false + } + ] }, "time": { "from": "now-30m", @@ -758,6 +592,6 @@ }, "timezone": "browser", "title": "VES Demo", - "version": 3 + "version": 2 } } diff --git a/tools/ves-setup.sh b/tools/ves-setup.sh index 19932fe..9aeb2ad 100644 --- a/tools/ves-setup.sh +++ b/tools/ves-setup.sh @@ -34,7 +34,7 @@ #. - Ubuntu Xenial (Centos support to be provided) #. - passwordless sudo setup for user running this script #. - shell environment variables setup as below (for non-default setting) -#. ves_mode: install mode (host|guest) for VES collectd plugin (default: host) +#. ves_mode: install mode (node|guest) for VES collectd plugin (default: node) #. ves_host: VES collector IP or hostname (default: 127.0.0.1) #. ves_port: VES collector port (default: 30000) #. ves_path: REST path optionalRoutingPath element (default: empty) @@ -92,7 +92,7 @@ function setup_env() { if [[ ! -f /tmp/ves/ves_env.sh ]]; then cat </tmp/ves/ves_env.sh #!/bin/bash -ves_mode="${ves_mode:=host}" +ves_mode="${ves_mode:=node}" ves_host="${ves_host:=127.0.0.1}" ves_hostname="${ves_hostname:=localhost}" ves_port="${ves_port:=30000}" @@ -203,7 +203,7 @@ function setup_collectd() { sudo systemctl start collectd.service log "setup VES collectd config for VES $ves_mode mode" - if [[ "$ves_mode" == "host" ]]; then + if [[ "$ves_mode" == "node" ]]; then # TODO: Barometer VES guide to clarify prerequisites install for Ubuntu log "setup additional prerequisites for VES host mode" sudo apt-get install -y libxml2-dev libpciaccess-dev libyajl-dev \ @@ -213,6 +213,8 @@ function setup_collectd() { # http://docs.opnfv.org/en/latest/submodules/barometer/docs/release/userguide/feature.userguide.html#virt-plugin sudo systemctl start libvirtd + # TODO: supposed to be merged with main collectd repo, but without this + # collectd still fails "plugin_load: Could not find plugin "virt" in /opt/collectd/lib/collectd" rm -rf /tmp/ves/collectd-virt git clone https://github.com/maryamtahhan/collectd /tmp/ves/collectd-virt cd /tmp/ves/collectd-virt @@ -221,17 +223,24 @@ function setup_collectd() { make sudo make install + # TODO: fix for journalctl -xe report "... is marked executable" + sudo chmod 744 /etc/systemd/system/collectd.service + cat < - LogLevel info - File "/opt/collectd/var/log/collectd.log" + LogLevel debug + File STDOUT Timestamp true PrintSeverity false -LoadPlugin cpu +LoadPlugin csv + + DataDir "/work-dir/collectd/install/var/lib/csv" + StoreRates false + #LoadPlugin virt # @@ -242,6 +251,32 @@ LoadPlugin cpu # ExtraStats "cpu_util" # +LoadPlugin target_set +LoadPlugin match_regex + + + + Plugin "^memory$" + + + PluginInstance "host" + + + + +LoadPlugin cpu + + ReportByCpu true + ReportByState true + ValuesPercentage true + + +LoadPlugin interface +LoadPlugin memory +LoadPlugin load +LoadPlugin disk +LoadPlugin uuid + LoadPlugin write_kafka Property "metadata.broker.list" "$ves_kafka_host:$ves_kafka_port" @@ -255,13 +290,29 @@ EOF # for VES plugin LoadPlugin logfile - LogLevel info - File "/opt/collectd/var/log/collectd.log" + LogLevel debug + File STDOUT Timestamp true PrintSeverity false LoadPlugin cpu + + ReportByCpu true + ReportByState true + ValuesPercentage true + + +LoadPlugin csv + + DataDir "/tmp" + + +LoadPlugin interface +LoadPlugin memory +LoadPlugin load +LoadPlugin disk +LoadPlugin uuid LoadPlugin write_kafka @@ -270,6 +321,19 @@ LoadPlugin write_kafka Format JSON + +LoadPlugin target_set +LoadPlugin match_regex + + + + Plugin "^memory$" + + + PluginInstance "guest" + + + EOF fi @@ -301,6 +365,9 @@ function setup_agent() { log "clone OPNFV Barometer" rm -rf /opt/ves/barometer git clone https://gerrit.opnfv.org/gerrit/barometer /opt/ves/barometer + # Test patch + cd /opt/ves/barometer + git fetch https://gerrit.opnfv.org/gerrit/barometer refs/changes/27/47427/1 && git checkout FETCH_HEAD log "setup ves_app_config.conf" source /opt/ves/ves_env.sh -- cgit 1.2.3-korg