From 6d154a3c89aab313aee1adb3dbc0ca39f90252e3 Mon Sep 17 00:00:00 2001 From: Vladimir Vitkov Date: Tue, 10 Nov 2015 16:08:40 +0200 Subject: [PATCH] tessera - graphing dashboard * nginx vhost * uwsgi app server * dashboards --- monitoring/tessera/README.md | 7 + .../dashboards/internet-connectivity.json | 272 ++++++++++++++++++ .../tessera/dashboards/wireless-stats.json | 173 +++++++++++ monitoring/tessera/nginx/tessera-vhost | 24 ++ monitoring/tessera/uwsgi/tessera.ini | 11 + 5 files changed, 487 insertions(+) create mode 100644 monitoring/tessera/README.md create mode 100644 monitoring/tessera/dashboards/internet-connectivity.json create mode 100644 monitoring/tessera/dashboards/wireless-stats.json create mode 100644 monitoring/tessera/nginx/tessera-vhost create mode 100644 monitoring/tessera/uwsgi/tessera.ini diff --git a/monitoring/tessera/README.md b/monitoring/tessera/README.md new file mode 100644 index 0000000..caf311d --- /dev/null +++ b/monitoring/tessera/README.md @@ -0,0 +1,7 @@ +# Tessera +Tessera is a nice JS dashboard + +# Prerequisites + * uwsgi + * nginx and separate vhost or port. Tessera does not run nice from subdir + * python-virtualenv diff --git a/monitoring/tessera/dashboards/internet-connectivity.json b/monitoring/tessera/dashboards/internet-connectivity.json new file mode 100644 index 0000000..0dcd38e --- /dev/null +++ b/monitoring/tessera/dashboards/internet-connectivity.json @@ -0,0 +1,272 @@ +{ + "id": 2, + "title": "Internet Connectivity", + "category": "Data", + "summary": "", + "description": "", + "creation_date": "2015-09-20T14:47:17.870112Z", + "last_modified_date": "2015-11-07T20:58:59.943634Z", + "imported_from": null, + "tags": [], + "definition": { + "options": {}, + "item_type": "dashboard_definition", + "item_id": "d3", + "items": [ + { + "title": "Uplink", + "item_type": "section", + "item_id": "d4", + "items": [ + { + "item_type": "row", + "item_id": "d27", + "items": [ + { + "item_type": "cell", + "item_id": "d28", + "items": [ + { + "item_type": "heading", + "item_id": "d29", + "text": "TX", + "level": 1 + } + ], + "span": 6 + }, + { + "item_type": "cell", + "item_id": "d30", + "items": [ + { + "item_type": "heading", + "item_id": "d31", + "text": "RX", + "level": 1 + } + ], + "span": 3 + } + ] + }, + { + "item_type": "row", + "item_id": "d9", + "items": [ + { + "item_type": "cell", + "item_id": "d10", + "items": [ + { + "title": "Peak Rate", + "item_type": "jumbotron_singlestat", + "item_id": "d11", + "query": "uplink_tx", + "format": ",.3s", + "transform": "max", + "units": "bps" + } + ], + "span": 4 + }, + { + "item_type": "cell", + "item_id": "d12", + "items": [ + { + "title": "Mean Rate", + "item_type": "singlestat", + "item_id": "d13", + "query": "uplink_tx", + "format": ",.3s", + "transform": "mean", + "units": "bps" + }, + { + "title": "Current Rate", + "item_type": "singlestat", + "item_id": "d14", + "query": "uplink_tx", + "format": ",.3s", + "transform": "last_non_zero", + "units": "bps" + } + ], + "span": 2 + }, + { + "item_type": "cell", + "item_id": "d20", + "items": [ + { + "title": "Peak Rate", + "item_type": "jumbotron_singlestat", + "item_id": "d21", + "query": "uplink_rx", + "format": ",.3s", + "transform": "max", + "units": "bps" + } + ], + "span": 4 + }, + { + "item_type": "cell", + "item_id": "d22", + "items": [ + { + "title": "Mean Rate", + "item_type": "singlestat", + "item_id": "d23", + "query": "uplink_rx", + "format": ",.3s", + "transform": "mean", + "units": "bps" + }, + { + "title": "Current Rate", + "item_type": "singlestat", + "item_id": "d24", + "query": "uplink_rx", + "format": ",.3s", + "transform": "last_non_zero", + "units": "bps" + } + ], + "span": 2 + } + ] + }, + { + "item_type": "row", + "item_id": "d5", + "items": [ + { + "item_type": "cell", + "item_id": "d6", + "items": [ + { + "title": "", + "options": { + "palette": "tableau10", + "y1": { + "label": "bps" + } + }, + "item_type": "bar_chart", + "item_id": "d8", + "height": 4, + "query": "uplink_combined", + "legend": "none", + "hide_zero_series": false, + "stack_mode": "none" + } + ], + "span": 12 + } + ] + } + ], + "level": 1, + "horizontal_rule": false, + "layout": "fixed" + } + ], + "queries": { + "stations": { + "name": "stations", + "targets": [ + "received.*.iwinfo-wlan*.stations.value" + ] + }, + "uplink_combined": { + "name": "uplink_combined", + "targets": [ + "group(scale(perSecond(received.eric.interface-eth1_50.if_octets.tx),8),\n scale(perSecond(received.eric.interface-eth1_50.if_octets.rx),-8))" + ] + }, + "uplink_rx": { + "name": "uplink_rx", + "targets": [ + "scale(perSecond(received.eric.interface-eth1_50.if_octets.rx),8)" + ] + }, + "uplink_tx": { + "name": "uplink_tx", + "targets": [ + "scale(perSecond(received.eric.interface-eth1_50.if_octets.tx),8)" + ] + }, + "video_combined": { + "name": "video_combined", + "targets": [ + "group(scale(perSecond(received.eric.interface-eth1_203.if_octets.tx),8), scale(perSecond(received.eric.interface-eth1_203.if_octets.rx),-8))" + ] + }, + "video_rx": { + "name": "video_rx", + "targets": [ + "scale(perSecond(received.eric.interface-eth1_203.if_octets.rx),8)" + ] + }, + "video_tx": { + "name": "video_tx", + "targets": [ + "scale(perSecond(received.eric.interface-eth1_203.if_octets.tx),8)" + ] + }, + "wifi_noise": { + "name": "wifi_noise", + "targets": [ + "dBmtomW(received.*.iwinfo-wlan*.signal_noise.value)" + ] + }, + "wifi_noise_dbm": { + "name": "wifi_noise_dbm", + "targets": [ + "received.*.iwinfo-wlan*.signal_noise.value" + ] + }, + "wired_combined": { + "name": "wired_combined", + "targets": [ + "group(scale(perSecond(received.eric.interface-eth1_201.if_octets.tx),8), scale(perSecond(received.eric.interface-eth1_201.if_octets.rx),-8))" + ] + }, + "wired_rx": { + "name": "wired_rx", + "targets": [ + "scale(perSecond(received.eric.interface-eth1_201.if_octets.rx),8)" + ] + }, + "wired_tx": { + "name": "wired_tx", + "targets": [ + "scale(perSecond(received.eric.interface-eth1_201.if_octets.tx),8)" + ] + }, + "wireless_combined": { + "name": "wireless_combined", + "targets": [ + "group(scale(perSecond(received.eric.interface-eth1_202.if_octets.tx),8), scale(perSecond(received.eric.interface-eth1_202.if_octets.rx),-8))" + ] + }, + "wireless_rx": { + "name": "wireless_rx", + "targets": [ + "scale(perSecond(received.eric.interface-eth1_202.if_octets.rx),8)" + ] + }, + "wireless_tx": { + "name": "wireless_tx", + "targets": [ + "scale(perSecond(received.eric.interface-eth1_202.if_octets.tx),8)" + ] + } + } + }, + "href": "/api/dashboard/2", + "view_href": "/dashboards/2/internet-connectivity", + "definition_href": "/api/dashboard/2/definition" +} \ No newline at end of file diff --git a/monitoring/tessera/dashboards/wireless-stats.json b/monitoring/tessera/dashboards/wireless-stats.json new file mode 100644 index 0000000..0b1a090 --- /dev/null +++ b/monitoring/tessera/dashboards/wireless-stats.json @@ -0,0 +1,173 @@ +{ + "id": 3, + "title": "Wireless", + "category": "Data", + "summary": "", + "description": "", + "creation_date": "2015-11-07T06:32:41.530934Z", + "last_modified_date": "2015-11-07T22:08:31.369260Z", + "imported_from": null, + "tags": [], + "definition": { + "options": {}, + "item_type": "dashboard_definition", + "item_id": "d3", + "items": [ + { + "item_type": "section", + "item_id": "d4", + "items": [ + { + "item_type": "row", + "item_id": "d5", + "items": [ + { + "item_type": "cell", + "item_id": "d13", + "items": [ + { + "options": { + "palette": "tableau10" + }, + "item_type": "bar_chart", + "item_id": "d14", + "height": 4, + "query": "stations", + "legend": "none", + "hide_zero_series": false, + "stack_mode": "stack" + } + ], + "span": 12 + } + ] + }, + { + "item_type": "row", + "item_id": "d8", + "items": [ + { + "item_type": "cell", + "item_id": "d9", + "items": [ + { + "title": "5GHz vs 2.4GHz", + "options": { + "palette": "tableau10", + "y1": { + "label": "Stations" + } + }, + "item_type": "bar_chart", + "item_id": "d10", + "query": "stations2_5", + "legend": "simple", + "hide_zero_series": false, + "stack_mode": "none" + }, + { + "item_type": "markdown", + "item_id": "d15", + "text": "The number of 5GHz associations (positive numbers) vs the number of 2.4 GHz associations (negative).", + "raw": false + } + ], + "span": 12 + } + ] + }, + { + "item_type": "row", + "item_id": "d16", + "items": [ + { + "item_type": "cell", + "item_id": "d17", + "items": [ + { + "title": "Stations in Per Hall", + "options": { + "palette": "numbers6", + "y1": { + "label": "Stations" + } + }, + "item_type": "bar_chart", + "item_id": "d18", + "query": "stations_for_domain", + "legend": "simple", + "hide_zero_series": false, + "stack_mode": "stack" + } + ], + "span": 12 + } + ] + } + ], + "level": 1, + "horizontal_rule": false, + "layout": "fixed" + } + ], + "queries": { + "stations": { + "name": "stations", + "targets": [ + "sumSeries(received.ap-*.iwinfo-wlan*.stations.value)" + ] + }, + "stations2_5": { + "name": "stations2_5", + "targets": [ + "group(sumSeries(received.ap-*-ac.iwinfo-wlan0.stations.value, received.ap-*-an.iwinfo-wlan1.stations.value),\nscale(sumSeries(received.ap-*-legacy.iwinfo-wlan0.stations.value),-1), scale(sumSeries(received.ap-*-ac.iwinfo-wlan1.stations.value, received.ap-*-an.iwinfo-wlan0.stations.value),-1))" + ] + }, + "stations_bulgaria": { + "name": "stations_bulgaria", + "targets": [ + "sumSeries(received.ap-bulgaria-*.iwinfo-wlan*.stations.value)" + ] + }, + "stations_chamber": { + "name": "stations_chamber", + "targets": [ + "sumSeries(received.ap-chamber-*.iwinfo-wlan*.stations.value)" + ] + }, + "stations_for_domain": { + "name": "stations_for_domain", + "targets": [ + "group(sumSeries(received.ap-bulgaria-*.iwinfo-wlan*.stations.value),\nsumSeries(received.ap-lobby1-*.iwinfo-wlan*.stations.value),\nsumSeries(received.ap-chamber-*.iwinfo-wlan*.stations.value),\nsumSeries(received.ap-marble-*.iwinfo-wlan*.stations.value),\nsumSeries(received.ap-music-*.iwinfo-wlan*.stations.value),\nsumSeries(received.ap-lobby2-*.iwinfo-wlan*.stations.value))" + ] + }, + "stations_lobby1": { + "name": "stations_lobby1", + "targets": [ + "sumSeries(received.ap-lobby1-*.iwinfo-wlan*.stations.value)" + ] + }, + "stations_lobby2": { + "name": "stations_lobby2", + "targets": [ + "sumSeries(received.ap-lobby2-*.iwinfo-wlan*.stations.value)" + ] + }, + "stations_marble": { + "name": "stations_marble", + "targets": [ + "sumSeries(received.ap-marble-*.iwinfo-wlan*.stations.value)" + ] + }, + "stations_music": { + "name": "stations_music", + "targets": [ + "sumSeries(received.ap-music-*.iwinfo-wlan*.stations.value)" + ] + } + } + }, + "href": "/api/dashboard/3", + "view_href": "/dashboards/3/wireless", + "definition_href": "/api/dashboard/3/definition" +} \ No newline at end of file diff --git a/monitoring/tessera/nginx/tessera-vhost b/monitoring/tessera/nginx/tessera-vhost new file mode 100644 index 0000000..7d5921a --- /dev/null +++ b/monitoring/tessera/nginx/tessera-vhost @@ -0,0 +1,24 @@ +server { + server_name tessera.openfest.org; + + listen 80; + listen [::]:80; + + root /var/www/html; + client_max_body_size 500M; + + location / { + limit_except GET{ + auth_basic "NO"; + auth_basic_user_file "/etc/tessera/htpasswd.users"; + } + try_files $uri @tessera; + } + + location @tessera { + include uwsgi_params; +# uwsgi_param SCRIPT_NAME tessera; + uwsgi_modifier1 30; + uwsgi_pass 127.0.0.1:3032; + } +} diff --git a/monitoring/tessera/uwsgi/tessera.ini b/monitoring/tessera/uwsgi/tessera.ini new file mode 100644 index 0000000..5752192 --- /dev/null +++ b/monitoring/tessera/uwsgi/tessera.ini @@ -0,0 +1,11 @@ +[uwsgi] +processes = 2 +socket = 127.0.0.1:3032 +gid = www-data +uid = www-data +chdir = /opt/tessera-pip/lib/python2.7/site-packages/tessera +#wsgi-file = /opt/graphite/conf/graphite.wsgi +home = /opt/tessera-pip +py-program-name = /opt/tessera-pip/bin/python +module = tessera +callable = app