diff options
38 files changed, 448 insertions, 321 deletions
diff --git a/.ci/appveyor/download_exes.py b/.ci/appveyor/download_exes.py index aa679d64..7db3848b 100644 --- a/.ci/appveyor/download_exes.py +++ b/.ci/appveyor/download_exes.py @@ -25,7 +25,7 @@ from concurrent.futures import ThreadPoolExecutor BASE_URL = 'https://ci.appveyor.com/api' -PY_VERSIONS = ['2.7', '3.4', '3.5', '3.6'] +PY_VERSIONS = ['2.7', '3.4', '3.5', '3.6', '3.7', '3.8'] def term_supports_colors(file=sys.stdout): diff --git a/.travis.yml b/.travis.yml index 0666dab8..b8d1f2cd 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,19 +1,27 @@ language: python + cache: pip + python: -- '2.7' -- '3.4' -- '3.5' -- '3.6' -- pypy + - '2.7' + - '3.4' + - '3.5' + - '3.6' + - '3.7' + - '3.8' + - pypy3 + install: -- pip install -r requirements.txt -- pip install coveralls + - pip install -r requirements.txt + - pip install coveralls + script: -- pip install . -- coverage run --source=glances unitest.py + - pip install . + - coverage run --source=glances unitest.py + after_success: -- coveralls + - coveralls + deploy: provider: pypi user: nicolargo @@ -2,6 +2,11 @@ Glances Version 3 ============================================================================== +Version 3.1.5 +============= + +Under development... + Version 3.1.4 ============= @@ -282,7 +282,7 @@ Start Termux on your device and enter: $ apt update $ apt upgrade - $ apt install clang python python-dev + $ apt install clang python $ pip install bottle $ pip install glances diff --git a/appveyor.yml b/appveyor.yml index e01646fe..6920d3f6 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -20,6 +20,14 @@ environment: PYTHON_VERSION: "3.6.x" PYTHON_ARCH: "32" + - PYTHON: "C:\\Python37" + PYTHON_VERSION: "3.7.x" + PYTHON_ARCH: "32" + + - PYTHON: "C:\\Python38" + PYTHON_VERSION: "3.8.x" + PYTHON_ARCH: "32" + # 64 bits - PYTHON: "C:\\Python27-x64" @@ -40,6 +48,20 @@ environment: VS_VER: "2015" INSTANCENAME: "SQL2012SP1" + - PYTHON: "C:\\Python37-x64" + PYTHON_VERSION: "3.7.x" + PYTHON_ARCH: "64" + ARCH: x86_64 + VS_VER: "2015" + INSTANCENAME: "SQL2012SP1" + + - PYTHON: "C:\\Python38-x64" + PYTHON_VERSION: "3.8.x" + PYTHON_ARCH: "64" + ARCH: x86_64 + VS_VER: "2015" + INSTANCENAME: "SQL2012SP1" + # Also build on a Python version not pre-installed by Appveyor. # See: https://github.com/ogrisel/python-appveyor-demo/issues/10 diff --git a/conf/glances-grafana.json b/conf/glances-grafana.json index 4d6cda5b..f6e7b8b7 100644 --- a/conf/glances-grafana.json +++ b/conf/glances-grafana.json @@ -141,8 +141,8 @@ "type": "time" } ], - "measurement": "localhost.load", - "query": "SELECT mean(\"cpucore\") FROM \"localhost.load\" WHERE $timeFilter GROUP BY time($interval)", + "measurement": "$host.load", + "query": "SELECT mean(\"cpucore\") FROM \"$host.load\" WHERE $timeFilter GROUP BY time($interval)", "refId": "A", "resultFormat": "time_series", "select": [ @@ -246,10 +246,10 @@ "type": "fill" } ], - "measurement": "localhost.load", + "measurement": "$host.load", "orderByTime": "ASC", "policy": "default", - "query": "SELECT mean(\"min1\") FROM \"localhost.load\" WHERE $timeFilter GROUP BY time($interval) fill(null)", + "query": "SELECT mean(\"min1\") FROM \"$host.load\" WHERE $timeFilter GROUP BY time($interval) fill(null)", "refId": "A", "resultFormat": "time_series", "select": [ @@ -289,10 +289,10 @@ "type": "fill" } ], - "measurement": "localhost.load", + "measurement": "$host.load", "orderByTime": "ASC", "policy": "default", - "query": "SELECT mean(\"min5\") FROM \"localhost.load\" WHERE $timeFilter GROUP BY time($interval) fill(null)", + "query": "SELECT mean(\"min5\") FROM \"$host.load\" WHERE $timeFilter GROUP BY time($interval) fill(null)", "refId": "B", "resultFormat": "time_series", "select": [ @@ -332,10 +332,10 @@ "type": "fill" } ], - "measurement": "localhost.load", + "measurement": "$host.load", "orderByTime": "ASC", "policy": "default", - "query": "SELECT mean(\"min15\") FROM \"localhost.load\" WHERE $timeFilter GROUP BY time($interval) fill(null)", + "query": "SELECT mean(\"min15\") FROM \"$host.load\" WHERE $timeFilter GROUP BY time($interval) fill(null)", "refId": "C", "resultFormat": "time_series", "select": [ @@ -467,10 +467,10 @@ "type": "time" } ], - "measurement": "localhost.processcount", + "measurement": "$host.processcount", "orderByTime": "ASC", "policy": "default", - "query": "SELECT mean(\"total\") FROM \"localhost.processcount\" WHERE $timeFilter GROUP BY time($interval)", + "query": "SELECT mean(\"total\") FROM \"$host.processcount\" WHERE $timeFilter GROUP BY time($interval)", "refId": "A", "resultFormat": "time_series", "select": [ @@ -563,10 +563,10 @@ "type": "fill" } ], - "measurement": "localhost.cpu", + "measurement": "$host.cpu", "orderByTime": "ASC", "policy": "default", - "query": "SELECT mean(\"user\") FROM \"localhost.cpu\" WHERE $timeFilter GROUP BY time($interval) fill(null)", + "query": "SELECT mean(\"user\") FROM \"$host.cpu\" WHERE $timeFilter GROUP BY time($interval) fill(null)", "refId": "A", "resultFormat": "time_series", "select": [ @@ -605,10 +605,10 @@ "type": "fill" } ], - "measurement": "localhost.cpu", + "measurement": "$host.cpu", "orderByTime": "ASC", "policy": "default", - "query": "SELECT mean(\"system\") FROM \"localhost.cpu\" WHERE $timeFilter GROUP BY time($interval) fill(null)", + "query": "SELECT mean(\"system\") FROM \"$host.cpu\" WHERE $timeFilter GROUP BY time($interval) fill(null)", "refId": "B", "resultFormat": "time_series", "select": [ @@ -648,10 +648,10 @@ "type": "fill" } ], - "measurement": "localhost.cpu", + "measurement": "$host.cpu", "orderByTime": "ASC", "policy": "default", - "query": "SELECT mean(\"iowait\") FROM \"localhost.cpu\" WHERE $timeFilter GROUP BY time($interval) fill(null)", + "query": "SELECT mean(\"iowait\") FROM \"$host.cpu\" WHERE $timeFilter GROUP BY time($interval) fill(null)", "refId": "C", "resultFormat": "time_series", "select": [ @@ -761,10 +761,10 @@ "type": "time" } ], - "measurement": "localhost.mem", + "measurement": "$host.mem", "orderByTime": "ASC", "policy": "default", - "query": "SELECT mean(\"used\") FROM \"localhost.mem\" WHERE $timeFilter GROUP BY time($__interval) fill(none)", + "query": "SELECT mean(\"used\") FROM \"$host.mem\" WHERE $timeFilter GROUP BY time($__interval) fill(none)", "rawQuery": true, "refId": "A", "resultFormat": "time_series", @@ -798,10 +798,10 @@ "type": "time" } ], - "measurement": "localhost.mem", + "measurement": "$host.mem", "orderByTime": "ASC", "policy": "default", - "query": "SELECT mean(\"total\") FROM \"localhost.mem\" WHERE $timeFilter GROUP BY time($__interval) fill(none)", + "query": "SELECT mean(\"total\") FROM \"$host.mem\" WHERE $timeFilter GROUP BY time($__interval) fill(none)", "rawQuery": true, "refId": "B", "resultFormat": "time_series", @@ -922,10 +922,10 @@ } ], "interval": "", - "measurement": "localhost.network", + "measurement": "$host.network", "orderByTime": "ASC", "policy": "default", - "query": "SELECT mean(\"$interface.rx\")/mean(\"$interface.time_since_update\")*8 FROM \"localhost.network\" WHERE $timeFilter GROUP BY time($interval) fill(none)", + "query": "SELECT mean(\"$interface.rx\")/mean(\"$interface.time_since_update\")*8 FROM \"$host.network\" WHERE $timeFilter GROUP BY time($interval) fill(none)", "rawQuery": true, "refId": "A", "resultFormat": "time_series", @@ -965,10 +965,10 @@ "type": "fill" } ], - "measurement": "localhost.network", + "measurement": "$host.network", "orderByTime": "ASC", "policy": "default", - "query": "SELECT mean(\"$interface.tx\")/mean(\"$interface.time_since_update\")*8*-1 FROM \"localhost.network\" WHERE $timeFilter GROUP BY time($interval) fill(none)", + "query": "SELECT mean(\"$interface.tx\")/mean(\"$interface.time_since_update\")*8*-1 FROM \"$host.network\" WHERE $timeFilter GROUP BY time($interval) fill(none)", "rawQuery": true, "refId": "B", "resultFormat": "time_series", @@ -1080,10 +1080,10 @@ "type": "time" } ], - "measurement": "localhost.memswap", + "measurement": "$host.memswap", "orderByTime": "ASC", "policy": "default", - "query": "SELECT mean(\"used\") FROM \"localhost.memswap\" WHERE $timeFilter GROUP BY time($__interval) fill(none)", + "query": "SELECT mean(\"used\") FROM \"$host.memswap\" WHERE $timeFilter GROUP BY time($__interval) fill(none)", "rawQuery": true, "refId": "A", "resultFormat": "time_series", @@ -1117,10 +1117,10 @@ "type": "time" } ], - "measurement": "localhost.memswap", + "measurement": "$host.memswap", "orderByTime": "ASC", "policy": "default", - "query": "SELECT mean(\"total\") FROM \"localhost.memswap\" WHERE $timeFilter GROUP BY time($__interval) fill(none)", + "query": "SELECT mean(\"total\") FROM \"$host.memswap\" WHERE $timeFilter GROUP BY time($__interval) fill(none)", "rawQuery": true, "refId": "B", "resultFormat": "time_series", @@ -1240,10 +1240,10 @@ "type": "fill" } ], - "measurement": "localhost.diskio", + "measurement": "$host.diskio", "orderByTime": "ASC", "policy": "default", - "query": "SELECT mean(\"$disk.read_bytes\")/mean(\"$disk.time_since_update\") FROM \"localhost.diskio\" WHERE $timeFilter GROUP BY time($__interval) fill(none)", + "query": "SELECT mean(\"$disk.read_bytes\")/mean(\"$disk.time_since_update\") FROM \"$host.diskio\" WHERE $timeFilter GROUP BY time($__interval) fill(none)", "rawQuery": true, "refId": "A", "resultFormat": "time_series", @@ -1283,10 +1283,10 @@ "type": "fill" } ], - "measurement": "localhost.diskio", + "measurement": "$host.diskio", "orderByTime": "ASC", "policy": "default", - "query": "SELECT mean(\"$disk.write_bytes\")/mean(\"$disk.time_since_update\") FROM \"localhost.diskio\" WHERE $timeFilter GROUP BY time($__interval) fill(none)", + "query": "SELECT mean(\"$disk.write_bytes\")/mean(\"$disk.time_since_update\") FROM \"$host.diskio\" WHERE $timeFilter GROUP BY time($__interval) fill(none)", "rawQuery": true, "refId": "B", "resultFormat": "time_series", @@ -1408,10 +1408,10 @@ "type": "fill" } ], - "measurement": "localhost.fs", + "measurement": "$host.fs", "orderByTime": "ASC", "policy": "default", - "query": "SELECT mean(\"/.used\") FROM \"localhost.fs\" WHERE $timeFilter GROUP BY time($interval) fill(null)", + "query": "SELECT mean(\"/.used\") FROM \"$host.fs\" WHERE $timeFilter GROUP BY time($interval) fill(null)", "refId": "A", "resultFormat": "time_series", "select": [ @@ -1450,10 +1450,10 @@ "type": "fill" } ], - "measurement": "localhost.fs", + "measurement": "$host.fs", "orderByTime": "ASC", "policy": "default", - "query": "SELECT mean(\"/.size\") FROM \"localhost.fs\" WHERE $timeFilter GROUP BY time($interval) fill(null)", + "query": "SELECT mean(\"/.size\") FROM \"$host.fs\" WHERE $timeFilter GROUP BY time($interval) fill(null)", "refId": "B", "resultFormat": "time_series", "select": [ @@ -1583,8 +1583,8 @@ "type": "time" } ], - "measurement": "localhost.fs", - "query": "SELECT mean(\"/.percent\") FROM \"localhost.fs\" WHERE $timeFilter GROUP BY time($interval)", + "measurement": "$host.fs", + "query": "SELECT mean(\"/.percent\") FROM \"$host.fs\" WHERE $timeFilter GROUP BY time($interval)", "refId": "A", "resultFormat": "time_series", "select": [ @@ -1692,10 +1692,10 @@ "type": "time" } ], - "measurement": "localhost.fs", + "measurement": "$host.fs", "orderByTime": "ASC", "policy": "default", - "query": "SELECT mean(\"/boot/efi.percent\") FROM \"localhost.fs\" WHERE $timeFilter GROUP BY time($interval)", + "query": "SELECT mean(\"/boot/efi.percent\") FROM \"$host.fs\" WHERE $timeFilter GROUP BY time($interval)", "refId": "A", "resultFormat": "time_series", "select": [ @@ -1750,7 +1750,7 @@ "aliasColors": { "CPU%": "#cca300", "MEM": "#2f575e", - "localhost.docker.mean": "#ba43a9" + "$host.docker.mean": "#ba43a9" }, "bars": false, "dashLength": 10, @@ -1785,7 +1785,7 @@ "repeatDirection": "v", "seriesOverrides": [ { - "alias": "localhost.docker.mean", + "alias": "$host.docker.mean", "fill": 0 }, { @@ -1820,10 +1820,10 @@ } ], "hide": false, - "measurement": "localhost.docker", + "measurement": "$host.docker", "orderByTime": "ASC", "policy": "default", - "query": "SELECT mean(\"$container.cpu_percent\") FROM \"localhost.docker\" WHERE $timeFilter GROUP BY time($__interval) fill(none)", + "query": "SELECT mean(\"$container.cpu_percent\") FROM \"$host.docker\" WHERE $timeFilter GROUP BY time($__interval) fill(none)", "rawQuery": true, "refId": "A", "resultFormat": "time_series", @@ -1861,7 +1861,7 @@ ], "orderByTime": "ASC", "policy": "default", - "query": "SELECT mean(\"$container.memory_usage\") FROM \"localhost.docker\" WHERE $timeFilter GROUP BY time($__interval) fill(none)", + "query": "SELECT mean(\"$container.memory_usage\") FROM \"$host.docker\" WHERE $timeFilter GROUP BY time($__interval) fill(none)", "rawQuery": true, "refId": "B", "resultFormat": "time_series", @@ -2011,10 +2011,10 @@ } ], "interval": "60s", - "measurement": "localhost.cpu", + "measurement": "$host.cpu", "orderByTime": "ASC", "policy": "default", - "query": "SELECT mean(\"user\") FROM \"localhost.cpu\" WHERE $timeFilter GROUP BY time($__interval) fill(none)", + "query": "SELECT mean(\"user\") FROM \"$host.cpu\" WHERE $timeFilter GROUP BY time($__interval) fill(none)", "rawQuery": false, "refId": "A", "resultFormat": "time_series", @@ -2055,10 +2055,10 @@ } ], "interval": "60s", - "measurement": "localhost.cpu", + "measurement": "$host.cpu", "orderByTime": "ASC", "policy": "default", - "query": "SELECT min(\"user\") FROM \"localhost.cpu\" WHERE $timeFilter GROUP BY time($__interval) fill(none)", + "query": "SELECT min(\"user\") FROM \"$host.cpu\" WHERE $timeFilter GROUP BY time($__interval) fill(none)", "rawQuery": false, "refId": "B", "resultFormat": "time_series", @@ -2100,10 +2100,10 @@ } ], "interval": "60s", - "measurement": "localhost.cpu", + "measurement": "$host.cpu", "orderByTime": "ASC", "policy": "default", - "query": "SELECT max(\"user\") FROM \"localhost.cpu\" WHERE $timeFilter GROUP BY time($__interval) fill(none)", + "query": "SELECT max(\"user\") FROM \"$host.cpu\" WHERE $timeFilter GROUP BY time($__interval) fill(none)", "rawQuery": false, "refId": "C", "resultFormat": "time_series", @@ -2237,10 +2237,10 @@ } ], "interval": "60s", - "measurement": "localhost.cpu", + "measurement": "$host.cpu", "orderByTime": "ASC", "policy": "default", - "query": "SELECT mean(\"system\") FROM \"localhost.cpu\" WHERE $timeFilter GROUP BY time($__interval) fill(none)", + "query": "SELECT mean(\"system\") FROM \"$host.cpu\" WHERE $timeFilter GROUP BY time($__interval) fill(none)", "rawQuery": false, "refId": "A", "resultFormat": "time_series", @@ -2281,10 +2281,10 @@ } ], "interval": "60s", - "measurement": "localhost.cpu", + "measurement": "$host.cpu", "orderByTime": "ASC", "policy": "default", - "query": "SELECT min(\"system\") FROM \"localhost.cpu\" WHERE $timeFilter GROUP BY time($__interval) fill(none)", + "query": "SELECT min(\"system\") FROM \"$host.cpu\" WHERE $timeFilter GROUP BY time($__interval) fill(none)", "rawQuery": false, "refId": "B", "resultFormat": "time_series", @@ -2326,10 +2326,10 @@ } ], "interval": "60s", - "measurement": "localhost.cpu", + "measurement": "$host.cpu", "orderByTime": "ASC", "policy": "default", - "query": "SELECT max(\"system\") FROM \"localhost.cpu\" WHERE $timeFilter GROUP BY time($__interval) fill(none)", + "query": "SELECT max(\"system\") FROM \"$host.cpu\" WHERE $timeFilter GROUP BY time($__interval) fill(none)", "rawQuery": false, "refId": "C", "resultFormat": "time_series", @@ -2465,10 +2465,10 @@ } ], "interval": "60s", - "measurement": "localhost.cpu", + "measurement": "$host.cpu", "orderByTime": "ASC", "policy": "default", - "query": "SELECT mean(\"iowait\") FROM \"localhost.cpu\" WHERE $timeFilter GROUP BY time($__interval) fill(none)", + "query": "SELECT mean(\"iowait\") FROM \"$host.cpu\" WHERE $timeFilter GROUP BY time($__interval) fill(none)", "rawQuery": false, "refId": "A", "resultFormat": "time_series", @@ -2509,10 +2509,10 @@ } ], "interval": "60s", - "measurement": "localhost.cpu", + "measurement": "$host.cpu", "orderByTime": "ASC", "policy": "default", - "query": "SELECT min(\"iowait\") FROM \"localhost.cpu\" WHERE $timeFilter GROUP BY time($__interval) fill(none)", + "query": "SELECT min(\"iowait\") FROM \"$host.cpu\" WHERE $timeFilter GROUP BY time($__interval) fill(none)", "rawQuery": false, "refId": "B", "resultFormat": "time_series", @@ -2554,10 +2554,10 @@ } ], "interval": "60s", - "measurement": "localhost.cpu", + "measurement": "$host.cpu", "orderByTime": "ASC", "policy": "default", - "query": "SELECT max(\"iowait\") FROM \"localhost.cpu\" WHERE $timeFilter GROUP BY time($__interval) fill(none)", + "query": "SELECT max(\"iowait\") FROM \"$host.cpu\" WHERE $timeFilter GROUP BY time($__interval) fill(none)", "rawQuery": false, "refId": "C", "resultFormat": "time_series", @@ -2678,10 +2678,10 @@ } ], "interval": "60s", - "measurement": "localhost.cpu", + "measurement": "$host.cpu", "orderByTime": "ASC", "policy": "default", - "query": "SELECT mean(\"ctx_switches\") / mean(\"time_since_update\") FROM \"localhost.cpu\" WHERE $timeFilter GROUP BY time($interval)", + "query": "SELECT mean(\"ctx_switches\") / mean(\"time_since_update\") FROM \"$host.cpu\" WHERE $timeFilter GROUP BY time($interval)", "rawQuery": false, "refId": "A", "resultFormat": "time_series", @@ -2801,10 +2801,10 @@ } ], "interval": "60s", - "measurement": "localhost.cpu", + "measurement": "$host.cpu", "orderByTime": "ASC", "policy": "default", - "query": "SELECT mean(\"interrupts\") / mean(\"time_since_update\") FROM \"localhost.cpu\" WHERE $timeFilter GROUP BY time($interval)", + "query": "SELECT mean(\"interrupts\") / mean(\"time_since_update\") FROM \"$host.cpu\" WHERE $timeFilter GROUP BY time($interval)", "rawQuery": false, "refId": "A", "resultFormat": "time_series", @@ -2920,7 +2920,7 @@ "type": "fill" } ], - "measurement": "localhost.sensors", + "measurement": "$host.sensors", "orderByTime": "ASC", "policy": "default", "refId": "A", @@ -3010,7 +3010,7 @@ "type": "fill" } ], - "measurement": "localhost.sensors", + "measurement": "$host.sensors", "orderByTime": "ASC", "policy": "default", "refId": "A", diff --git a/conf/glances.conf b/conf/glances.conf index 8cd2723a..a9802d7f 100644 --- a/conf/glances.conf +++ b/conf/glances.conf @@ -189,7 +189,7 @@ critical=90 [irq] # Documentation: https://glances.readthedocs.io/en/stable/aoa/irq.html # This plugin is disabled by default -disable=True +disable=False [folders] # Documentation: https://glances.readthedocs.io/en/stable/aoa/folders.html @@ -572,8 +572,9 @@ countmax=20 [amp_conntrack] # Use comma separated for multiple commands (no space around the comma) +# If the regex key is not defined, the AMP will be executed every refresh second +# and the process count will not be displayed (countmin and countmax will be ignore) enable=false -regex=\/sbin\/init refresh=30 one_line=false command=sysctl net.netfilter.nf_conntrack_count;sysctl net.netfilter.nf_conntrack_max diff --git a/docker-files/master/Dockerfile b/docker-files/master/Dockerfile index f4d55d9d..b2c874c1 100644 --- a/docker-files/master/Dockerfile +++ b/docker-files/master/Dockerfile @@ -7,10 +7,28 @@ # Pull base image. FROM ubuntu:20.04 -# Install Glances (develop branch) -RUN apt-get update && apt-get -y install curl iputils-ping && rm -rf /var/lib/apt/lists/* -RUN curl -L https://raw.githubusercontent.com/nicolargo/glancesautoinstall/master/install.sh | /bin/bash && rm -rf /var/lib/apt/lists/* +# Install package +# Must used calibre package to be able to run external module +ENV DEBIAN_FRONTEND noninteractive +RUN \ + apt-get update && \ + apt-get install -y \ + curl \ + gcc \ + lm-sensors \ + wireless-tools \ + iputils-ping \ + python3-pip \ + python3-dev && \ + rm -rf /var/lib/apt/lists/* + +## Instal glances +RUN \ + pip3 install --upgrade pip && \ + pip3 install setuptools \ + glances[action,batinfo,browser,cpuinfo,docker,export,folders,gpu,graph,ip,raid,snmp,web,wifi] \ + glances # Define working directory. WORKDIR /glances @@ -22,4 +40,4 @@ EXPOSE 61209 EXPOSE 61208 # Define default command. -CMD python -m glances -C /glances/conf/glances.conf $GLANCES_OPT +CMD python3 -m glances -C /glances/conf/glances.conf $GLANCES_OPT diff --git a/docs/aoa/actions.rst b/docs/aoa/actions.rst index b83f1737..448d4fea 100644 --- a/docs/aoa/actions.rst +++ b/docs/aoa/actions.rst @@ -16,7 +16,9 @@ then add the ``_action`` line to the Glances configuration file: critical_action=python /path/to/foo.py All the stats are available in the command line through the use of the -`{{mustache}}`_ syntax. Another example would be to create a log file |