glances icon indicating copy to clipboard operation
glances copied to clipboard

Monitoring network adapters

Open CodeAnthem opened this issue 2 years ago • 6 comments

Describe the bug Glances doesn't monitor traffic of network usage inside docker

To Reproduce Steps to reproduce the behavior:

  1. Add a macvlan network to glances
  2. Exec into glances and ping a host inside the network -> shows usage
  3. Exec into another container in the same network, ping a host inside the network (not glances) -> shows no usage

Expected behavior I expect to see usage of the network adapter of other containers inside the monitored network

Desktop (please complete the following information):

  • OS: Debian GNU/Linux 10 64bit / Linux 5.10.0-0.bpo.12-amd64
  • Docker: 20.10.17
  • Glances Version: Glances v3.2.4.2 with PsUtil v5.8.0
  • Glances logs file:
2022-06-29 11:39:04,987 -- INFO -- Start Glances 3.2.4.2
2022-06-29 11:39:04,987 -- INFO -- CPython 3.9.9 (/usr/local/bin/python3) and psutil 5.8.0 detected
2022-06-29 11:39:04,994 -- INFO -- Read configuration file '/glances/conf/glances.conf'
2022-06-29 11:39:05,023 -- INFO -- Start GlancesWebServer mode
2022-06-29 11:39:05,245 -- WARNING -- Wifi lib is not compliant with Python 3, Wifi plugin is disabled
2022-06-29 11:39:06,815 -- INFO -- Glances RESTful API Server started on http://0.0.0.0:61208/api/3/
2022-06-29 11:39:06,818 -- INFO -- Glances Web User Interface started on http://0.0.0.0:61208/
2022-06-29 11:39:35,507 -- INFO -- Start Glances 3.2.4.2
2022-06-29 11:39:35,507 -- INFO -- CPython 3.9.9 (/usr/local/bin/python) and psutil 5.8.0 detected
  • Glances test [output of glances --issue] (only available with Glances 3.1.7 or higher)

Additional context Since I use traefik I can't use network host

CodeAnthem avatar Jun 29 '22 11:06 CodeAnthem

Glances uses the default Docker API to grab the network usage.

Is it working if you use the "docker stats" command line instead of Glances ?

nicolargo avatar Jul 05 '22 08:07 nicolargo

docker stats doesn't show any eth ....

CONTAINER ID NAME CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS bd6b628457ec nervous_jemison 0.00% 150.1MiB / 78.56GiB 0.19% 316MB / 7.41MB 14.5MB / 904MB 6

mamema avatar Jul 08 '22 06:07 mamema

Hi, honestly I don't know how to use docker stats, if I do docker stats containername (of other container which uses the eth connection I'd like to monitor, I can't see any useful information, besides some network traffic, but not the actual bandwith usage.

CodeAnthem avatar Jul 08 '22 23:07 CodeAnthem

@averon420 Just run 'docker stats'

The 6 column show the NET I/O

nicolargo avatar Jul 09 '22 06:07 nicolargo

@averon420 Just run 'docker stats'

The 6 column show the NET I/O

Then I see the traffic usage of all containers, which is not the actually bandwith. But yesI can see it.

CodeAnthem avatar Jul 09 '22 13:07 CodeAnthem

The nitrate is compute by Glances based on the same metrics. So it should work... You should wait more or less 6 seconds after Glances start in order to see it.

Also try this to investigate:

glances --stdout docker

nicolargo avatar Jul 09 '22 13:07 nicolargo