diff options
author | nicolargo <nicolas@nicolargo.com> | 2023-03-12 09:44:43 +0100 |
---|---|---|
committer | nicolargo <nicolas@nicolargo.com> | 2023-03-12 09:44:43 +0100 |
commit | db4bd0d136707ffe58620825aa147eff1d3640bf (patch) | |
tree | 8a4676eb7cbdc2634ae4062bf0ed46f47855296c | |
parent | 70aa46d4a0b6ad8ff6f4aa02eaad1d938ab891e3 (diff) | |
parent | 43291246de969abef0acfcc9fe1841cd0ac95d9c (diff) |
Merge from develop
66 files changed, 4551 insertions, 1325 deletions
@@ -1,20 +1,7 @@ [flake8] - +exclude = .git,__pycache__,docs/,build,dist ignore = - W504 # line break after binary operator - - # --- flake8-bugbear plugin - B007 # Loop control variable 'keyword' not used within the loop body. If this is intended, start the name with an underscore. - B014 # Redundant exception types in `except (IOError, OSError) as err:`. Write `except OSError as err:`, which catches exactly the same exceptions. - B008 # Do not perform function calls in argument defaults. - - # --- flake8-blind-except plugin - B902 # blind except Exception: statement - - # --- flake8-quotes plugin - Q000 # Double quotes found but single quotes preferred - - # --- flake8-quotes naming; disable all except N804 and N805 + W504, B007, B014, B008, B902, Q000, N801, N802, N803, N806, N807, N811, N812, N813, N814, N815, N816, N817, N818 # lines should not exceed 120 characters diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 2d9d1376..cbe49e79 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -96,7 +96,7 @@ jobs: strategy: fail-fast: false matrix: - os: ['alpine'] + os: ['alpine', 'ubuntu'] tag: ${{ fromJson(needs.create_Docker_builds.outputs.tags) }} steps: - name: Checkout @@ -104,7 +104,7 @@ jobs: - name: Retrieve Repository Docker metadata id: docker_meta - uses: crazy-max/ghaction-docker-meta@v4.1.1 + uses: crazy-max/ghaction-docker-meta@v4.3.0 with: images: ${{ env.DEFAULT_DOCKER_IMAGE }} labels: | @@ -136,7 +136,7 @@ jobs: password: ${{ secrets.DOCKER_TOKEN }} - name: Build and push image - uses: docker/build-push-action@v3 + uses: docker/build-push-action@v4 with: push: ${{ env.PUSH_BRANCH == 'true' }} tags: "${{ env.DEFAULT_DOCKER_IMAGE }}:${{ matrix.os != 'alpine' && format('{0}-', matrix.os) || '' }}${{ matrix.tag.tag }}" @@ -64,6 +64,9 @@ flake8: venv-dev-upgrade ## Run flake8 linter. codespell: venv-dev-upgrade ## Run codespell to fix common misspellings in text files ./venv/bin/codespell -S .git,./docs/_build,./Glances.egg-info,./venv,./glances/outputs,*.svg -L hart,bu,te,statics +semgrep: venv-dev-upgrade ## Run semgrep to find bugs and enforce code standards + ./venv/bin/semgrep --config=auto --lang python --use-git-ignore ./glances + profiling: ## How to start the profiling of the Glances software @echo "Please complete and run: sudo ./venv/bin/py-spy record -o ./docs/_static/glances-flame.svg -d 60 -s --pid <GLANCES PID>" @@ -137,6 +140,11 @@ docker-alpine: ## Generate local docker images (Alpine) docker build --target minimal -f ./docker-files/alpine.Dockerfile -t glances:local-alpine-minimal . docker build --target dev -f ./docker-files/alpine.Dockerfile -t glances:local-alpine-dev . +docker-ubuntu: ## Generate local docker images (Ubuntu) + docker build --target full -f ./docker-files/ubuntu.Dockerfile -t glances:local-ubuntu-full . + docker build --target minimal -f ./docker-files/ubuntu.Dockerfile -t glances:local-ubuntu-minimal . + docker build --target dev -f ./docker-files/ubuntu.Dockerfile -t glances:local-ubuntu-dev . + # =================================================================== # Run # =================================================================== @@ -151,13 +159,22 @@ run-local-conf: ## Start Glances in console mode with the system conf file ./venv/bin/python -m glances run-docker-alpine-minimal: ## Start Glances Alpine Docker minimal in console mode - docker run --rm -v /var/run/docker.sock:/var/run/docker.sock:ro --pid host --network host -it glances:local-alpine-minimal + docker run --rm -e TZ="${TZ}" -v /var/run/docker.sock:/var/run/docker.sock:ro --pid host --network host -it glances:local-alpine-minimal run-docker-alpine-full: ## Start Glances Alpine Docker full in console mode - docker run --rm -v /var/run/docker.sock:/var/run/docker.sock:ro --pid host --network host -it glances:local-alpine-full + docker run --rm -e TZ="${TZ}" -v /var/run/docker.sock:/var/run/docker.sock:ro --pid host --network host -it glances:local-alpine-full run-docker-alpine-dev: ## Start Glances Alpine Docker dev in console mode - docker run --rm -v /var/run/docker.sock:/var/run/docker.sock:ro --pid host --network host -it glances:local-alpine-dev + docker run --rm -e TZ="${TZ}" -v /var/run/docker.sock:/var/run/docker.sock:ro --pid host --network host -it glances:local-alpine-dev + +run-docker-ubuntu-minimal: ## Start Glances Ubuntu Docker minimal in console mode + docker run --rm -e TZ="${TZ}" -v /var/run/docker.sock:/var/run/docker.sock:ro --pid host --network host -it glances:local-ubuntu-minimal + +run-docker-ubuntu-full: ## Start Glances Ubuntu Docker full in console mode + docker run --rm -e TZ="${TZ}" -v /var/run/docker.sock:/var/run/docker.sock:ro --pid host --network host -it glances:local-ubuntu-full + +run-docker-ubuntu-dev: ## Start Glances Ubuntu Docker dev in console mode + docker run --rm -e TZ="${TZ}" -v /var/run/docker.sock:/var/run/docker.sock:ro --pid host --network host -it glances:local-ubuntu-dev run-webserver: ## Start Glances in Web server mode ./venv/bin/python -m glances -C ./conf/glances.conf -w @@ -3,10 +3,81 @@ ============================================================================== =============== +Version 3.4.0 +=============== + + See roadmap here: https://github.com/nicolargo/glances/issues?q=is%3Aopen+is%3Aissue+milestone%3A%22Glances+3.4.0%22 + +=============== +Version 3.3.1.1 +=============== + +Hard patch on the master branch. + +Bug corrected: + + * "ModuleNotFoundError: No module named 'ujson'" #2246 + * Remove surrounding quotes for quoted command arguments #2247 (related to #2239) + +=============== Version 3.3.1 =============== - Under development, see milestone https://github.com/nicolargo/glances/milestone/61 +Enhancements: + + * Minor change on the help screen + * Refactor some loop in the processes function + * Replace json by ujson #2201 + +Bug corrected: + + * Unable to see docker related information #2180 + * CSV export dependent on sort order for docker container cpu #2156 + * Error when process list is displayed in Programs mode #2209 + * Console formatting permanently messed up when other text printed #2211 + * API GET uptime returns formatted string, not seconds as the doc says #2158 + * Glances UI is breaking for multiline commands #2189 + +Documentation and CI: + + * Add unitary test for memory profiling + * Update memory profile chart + * Add run-docker-ubuntu-* in Makefile + * The open-web-browser option was missing dashes #2219 + * Correct regexp in glances.conf file example + * What is CW from network #2222 (related to discussion #2221) + * Change Glances repology URL + * Add example for the date format + * Correct Flake8 configuration file + * Drop UT for Python 3.5 and 3.6 (no more available in Ubuntu 22.04) + * Correct unitary test with Python 3.5 + * Update Makefile with comments + * Update Python minimal requirement for py3nvlm + * Update security policy (user can open private issue directly in Github) + * Add a simple run script. Entry point for IDE debuger + +Cyber security update: + + * Security alert on ujson < 5.4 + * Merge pull request #2243 from nicolargo/renovate/nvidia-cuda-12.x + * Merge pull request #2244 from nicolargo/renovate/crazy-max-ghaction-docker-meta-4.x + * Merge pull request #2228 from nicolargo/renovate/zeroconf-0.x + * Merge pull request #2242 from nicolargo/renovate/crazy-max-ghaction-docker-meta-4.x + * Merge pull request #2239 from mfridge/action-command-split + * Merge pull request #2165 from nicolargo/renovate/zeroconf-0.x + * Merge pull request #2199 from nicolargo/renovate/alpine-3.x + * Merge pull request #2202 from chncaption/oscs_fix_cdr0ts8au51t49so8c6g + * Bump loader-utils from 2.0.0 to 2.0.3 in /glances/outputs/static #2187 - Update Web lib + +Contributors for this version: + + * Nicolargo + * renovate[bot] + * chncaption + * fkwong + * *mfridge + +And also a big thanks to @RazCrimson (https://github.com/RazCrimson) for the support to the Glances community ! =============== Version 3.3.0.4 @@ -40,16 +40,22 @@ Glances - An eye on your system Summary ======= -**Glances** is a cross-platform monitoring tool which aims to present a -large amount of monitoring information through a curses or Web -based interface. The information dynamically adapts depending on the -size of the user interface. +**Glances** is an open-source system cross-platform monitoring tool. +It allows real-time monitoring of various aspects of your system such as +CPU, memory, disk, network usage etc. It also allows monitoring of running processes, +logged in users, temperatures, voltages, fan speeds etc. +It also supports container monitoring, it supports different container management +systems such as Docker, LXC. The information is presented in an easy to read dashboard +and can also be used for remote monitoring of systems via a web interface or command +line interface. It is easy to install and use and can be customized to show only +the information that you are interested in. .. image:: https://raw.githubusercontent.com/nicolargo/glances/develop/docs/_static/glances-summary.png -It can also work in client/server mode. Remote monitoring could be done -via terminal, Web interface or API (XML-RPC and RESTful). Stats can also -be exported to files or external time/value databases. +In client/server mode, remote monitoring could be done via terminal, +Web interface or API (XML-RPC and RESTful). +Stats can also be exported to files or external time/value databases, CSV or direct +output to STDOUT. .. image:: https://raw.githubusercontent.com/nicolargo/glances/develop/docs/_static/glances-responsive-webdesign.png @@ -105,6 +111,7 @@ Optional dependencies: - ``py-cpuinfo`` (for the Quicklook CPU info module) - ``pygal`` (for the graph export module) - ``pymdstat`` (for RAID support) [Linux-only] +- ``pymongo`` (for the MongoDB export module) [Only for Python >= 3.7] - ``pysnmp`` (for SNMP support) - ``pySMART.smartx`` (for HDD Smart support) [Linux-only] - ``pyzmq`` (for the ZeroMQ export module) @@ -207,7 +214,7 @@ Run last version of Glances container in *console mode*: .. code-block:: console - docker run --rm -v /var/run/docker.sock:/var/run/docker.sock:ro --pid host --network host -it nicolargo/glances:latest-full + docker run --rm -e TZ="${TZ}" -v /var/run/docker.sock:/var/run/docker.sock:ro --pid host --network host -it nicolargo/glances:latest-full Additionally, if you want to use your own glances.conf file, you can create your own Dockerfile: @@ -224,7 +231,7 @@ variable setting parameters for the glances startup command): .. code-block:: console - docker run -v `pwd`/glances.conf:/etc/glances.conf -v /var/run/docker.sock:/var/run/docker.sock:ro --pid host -e GLANCES_OPT="-C /etc/glances.conf" -it nicolargo/glances:latest-full + docker run -e TZ="${TZ}" -v `pwd`/glances.conf:/etc/glances.conf -v /var/run/docker.sock:/var/run/docker.sock:ro --pid host -e GLANCES_OPT="-C /etc/glances.conf" -it nicolargo/glances:latest-full Where \`pwd\`/glances.conf is a local directory containing your glances.conf file. @@ -232,7 +239,7 @@ Run the container in *Web server mode*: .. code-block:: console - docker run -d --restart="always" -p 61208-61209:61208-61209 -e GLANCES_OPT="-w" -v /var/run/docker.sock:/var/run/docker.sock:ro --pid host nicolargo/glances:latest-full + docker run -d --restart="always" -p 61208-61209:61208-61209 -e TZ="${TZ}" -e GLANCES_OPT="-w" -v /var/run/docker.sock:/var/run/docker.sock:ro --pid host nicolargo/glances:latest-full GNU/Linux --------- @@ -464,7 +471,7 @@ Glances is distributed under the LGPL version 3 license. See ``COPYING`` for mor .. _readthedocs: https://glances.readthedocs.io/ .. _forum: https://groups.google.com/forum/?hl=en#!forum/glances-users .. _wiki: https://github.com/nicolargo/glances/wiki/How-to-contribute-to-Glances-%3F -.. _package: https://repology.org/metapackage/glances/packages +.. _package: https://repology.org/project/glances/versions .. _sponsors: https://github.com/sponsors/nicolargo .. _wishlist: https://www.amazon.fr/hz/wishlist/ls/BWAAQKWFR3FI?ref_=wl_share .. _issue2021: https://github.com/nicolargo/glances/issues/2021#issuecomment-1197831157 diff --git a/conf/glances.conf b/conf/glances.conf index d40a9715..b273e5ea 100644 --- a/conf/glances.conf +++ b/conf/glances.conf @@ -12,6 +12,8 @@ check_update=true # History size (maximum number of values) # Default is 1200 values (~1h with the default refresh rate) history_size=1200 +# Set the way Glances should display the date (default is %Y-%m-%d %H:%M:%S %Z) +#strftime_format="%Y-%m-%d %H:%M:%S %Z" ############################################################################## # User interface @@ -212,7 +214,7 @@ critical=-85 disable=False # Define the list of hidden disks (comma-separated regexp) #hide=sda2,sda5,loop.* -hide=loop.*,/dev/loop* +hide=loop.*,/dev/loop.* # Define the list of disks to be show (comma-separated) #show=sda.* # Alias for sda1 @@ -235,12 +237,12 @@ critical=90 #allow=shm [irq] -# Documentation: https://glances.readthedocs.io/en/stable/aoa/irq.html +# Documentation: https://glances.readthedocs.io/en/latest/aoa/irq.html # This plugin is disabled by default disable=True [folders] -# Documentation: https://glances.readthedocs.io/en/stable/aoa/folders.html +# Documentation: https://glances.readthedocs.io/en/latest/aoa/folders.html disable=False # Define a folder list to monitor # The list is composed of items (list_#nb <= 10) @@ -261,13 +263,18 @@ disable=False #folder_3_path=/nonexisting #folder_4_path=/root +[cloud] +# Documentation: https://glances.readthedocs.io/en/latest/aoa/cloud.html +# This plugin is disabled by default +disable=True + [raid] -# Documentation: https://glances.readthedocs.io/en/stable/aoa/raid.html +# Documentation: https://glances.readthedocs.io/en/latest/aoa/raid.html # This plugin is disabled by default disable=True [smart] -# Documentation: https://glances.readthedocs.io/en/stable/aoa/smart.html +# Documentation: https://glances.readthedocs.io/en/latest/aoa/smart.html # This plugin is disabled by default disable=True @@ -305,6 +312,7 @@ battery_critical=95 #core 0_fans_speed_alias=CPU Core 0 fan #or #core 0_alias=CPU Core 0 +#core 1_alias=CPU Core 1 [processcount] disable=False @@ -581,6 +589,15 @@ db=glances #user=root #password=root +[mongodb] +# Configuration for the --export mongodb option +# https://www.mongodb.com +host=localhost +port=27017 +db=glances +user=root +password=example + [kafka] # Configuration for the --export kafka option # http://kafka.apache.org/ diff --git a/dev-requirements.txt b/dev-requirements.txt index b78acaa3..f548a0eb 100644 --- a/dev-requirements.txt +++ b/dev-requirements.txt @@ -8,4 +8,6 @@ autoflake codespell memory-profiler matplotlib -setuptools>=65.5.1 # not directly required, pinned by Snyk to avoid a vulnerability
\ No newline at end of file +semgrep +setuptools>=65.5.1 # not directly required, pinned by Snyk to avoid a vulnerability +numpy>=1.22.2 # not directly required, pinned by Snyk to avoid a vulnerability
\ No newline at end of file diff --git a/docker-compose/docker-compose-with-traefik.yml b/docker-compose/docker-compose-with-traefik.yml index db29890f..786aa905 100644 --- a/docker-compose/docker-compose-with-traefik.yml +++ b/docker-compose/docker-compose-with-traefik.yml @@ -21,9 +21,11 @@ services: privileged: true network_mode: "host" volumes: - - /var/run/docker.sock:/var/run/docker.sock + - "/var/run/docker.sock:/var/run/docker.sock:ro" + - "./glances.conf:/glances/conf/glances.conf" environment: - - "GLANCES_OPT=-w" + - GLANCES_OPT: "-C /glances/conf/glances.conf -w" + - TZ: "${TZ}" labels: - "traefik.port=61208" - "traefik.frontend.rule=Host:glances.docker.localhost" diff --git a/docker-compose/docker-compose.yml b/docker-compose/docker-compose.yml index ee50dc4b..703d8775 100644 --- a/docker-compose/docker-compose.yml +++ b/docker-compose/docker-compose.yml @@ -5,13 +5,12 @@ services: context: ./ dockerfile: Dockerfile restart: always - ports: - - "61208:61208" - environment: - GLANCES_OPT: "-C /glances/conf/glances.conf -w" - volumes: - - "/var/run/docker.sock:/var/run/docker.sock:ro" - - "./glances.conf:/glances/conf/glances.conf" pid: "host" privileged: true network_mode: "host" + volumes: + - "/var/run/docker.sock:/var/run/docker.sock:ro" + - "./glances.conf:/glances/conf/glances.conf" + environment: + - GLANCES_OPT: "-C /glances/conf/glances.conf -w" + - TZ: "${TZ}" diff --git a/docker-compose/glances.conf b/docker-compose/glances.conf index 6f6e4180..d666b01a 100644 --- a/docker-compose/glances.conf +++ b/docker-compose/glances.conf @@ -10,8 +10,10 @@ refresh=2 # Does Glances should check if a newer version is available on PyPI ? check_update=false # History size (maximum number of values) -# Default is 3600 seconds (1 hour) -history_size=3600 +# Default is 1200 values (~1h with the default refresh rate) +history_size=1200 +# Set the way Glances should display the date (default is %Y-%m-%d %H:%M:%S %Z) +#strftime_format="%Y-%m-%d %H:%M:%S %Z" ############################################################################## # User interface @@ -212,7 +214,7 @@ critical=-85 disable=False # Define the list of hidden disks (comma- |