ualex73 / monitor_docker

Monitor Docker containers from Home Assistant
Apache License 2.0
301 stars 37 forks source link

Cannot determine memory usage for container ('usage') and Raw 'memory_stats' #159

Closed z-master42 closed 2 months ago

z-master42 commented 2 months ago

I have the following configuration in my configuration.yaml and the corresponding entities are displayed and so far everything works.

monitor_docker:
  - url: "http://192.168.42.85:2375"
    name: Docker
    switchenabled: True
    buttonenabled: True
    monitored_conditions:
      - state
      - 1cpu_percentage

However, I have the following two error messages in my logs, and I have not selected the memory entities at all.

Logger: custom_components.monitor_docker.helpers
Quelle: custom_components/monitor_docker/helpers.py:1028
Integration: Monitor Docker (Dokumentation, Probleme)
Erstmals aufgetreten: 18:19:53 (8 Vorkommnisse)
Zuletzt protokolliert: 18:19:55

[Docker] SolarFlow-Statuspage: Cannot determine memory usage for container ('usage')
[Docker] Pi-hole: Cannot determine memory usage for container ('usage')
[Docker] portainer: Cannot determine memory usage for container ('usage')
[Docker] etesync-dav: Cannot determine memory usage for container ('usage')
[Docker] WatchTower: Cannot determine memory usage for container ('usage')
Logger: custom_components.monitor_docker.helpers
Quelle: custom_components/monitor_docker/helpers.py:1035
Integration: Monitor Docker (Dokumentation, Probleme)
Erstmals aufgetreten: 18:19:53 (8 Vorkommnisse)
Zuletzt protokolliert: 18:19:55

[Docker] SolarFlow-Statuspage: Raw 'memory_stats' {'stats': {'active_anon': 0, 'active_file': 0, 'anon': 0, 'anon_thp': 0, 'file': 0, 'file_dirty': 0, 'file_mapped': 0, 'file_writeback': 0, 'inactive_anon': 0, 'inactive_file': 0, 'kernel_stack': 0, 'pgactivate': 0, 'pgdeactivate': 0, 'pgfault': 0, 'pglazyfree': 0, 'pglazyfreed': 0, 'pgmajfault': 0, 'pgrefill': 0, 'pgscan': 0, 'pgsteal': 0, 'shmem': 0, 'slab': 0, 'slab_reclaimable': 0, 'slab_unreclaimable': 0, 'sock': 0, 'thp_collapse_alloc': 0, 'thp_fault_alloc': 0, 'unevictable': 0, 'workingset_activate': 0, 'workingset_nodereclaim': 0, 'workingset_refault': 0}}
[Docker] Pi-hole: Raw 'memory_stats' {'stats': {'active_anon': 0, 'active_file': 0, 'anon': 0, 'anon_thp': 0, 'file': 0, 'file_dirty': 0, 'file_mapped': 0, 'file_writeback': 0, 'inactive_anon': 0, 'inactive_file': 0, 'kernel_stack': 0, 'pgactivate': 0, 'pgdeactivate': 0, 'pgfault': 0, 'pglazyfree': 0, 'pglazyfreed': 0, 'pgmajfault': 0, 'pgrefill': 0, 'pgscan': 0, 'pgsteal': 0, 'shmem': 0, 'slab': 0, 'slab_reclaimable': 0, 'slab_unreclaimable': 0, 'sock': 0, 'thp_collapse_alloc': 0, 'thp_fault_alloc': 0, 'unevictable': 0, 'workingset_activate': 0, 'workingset_nodereclaim': 0, 'workingset_refault': 0}}
[Docker] portainer: Raw 'memory_stats' {'stats': {'active_anon': 0, 'active_file': 0, 'anon': 0, 'anon_thp': 0, 'file': 0, 'file_dirty': 0, 'file_mapped': 0, 'file_writeback': 0, 'inactive_anon': 0, 'inactive_file': 0, 'kernel_stack': 0, 'pgactivate': 0, 'pgdeactivate': 0, 'pgfault': 0, 'pglazyfree': 0, 'pglazyfreed': 0, 'pgmajfault': 0, 'pgrefill': 0, 'pgscan': 0, 'pgsteal': 0, 'shmem': 0, 'slab': 0, 'slab_reclaimable': 0, 'slab_unreclaimable': 0, 'sock': 0, 'thp_collapse_alloc': 0, 'thp_fault_alloc': 0, 'unevictable': 0, 'workingset_activate': 0, 'workingset_nodereclaim': 0, 'workingset_refault': 0}}
[Docker] etesync-dav: Raw 'memory_stats' {'stats': {'active_anon': 0, 'active_file': 0, 'anon': 0, 'anon_thp': 0, 'file': 0, 'file_dirty': 0, 'file_mapped': 0, 'file_writeback': 0, 'inactive_anon': 0, 'inactive_file': 0, 'kernel_stack': 0, 'pgactivate': 0, 'pgdeactivate': 0, 'pgfault': 0, 'pglazyfree': 0, 'pglazyfreed': 0, 'pgmajfault': 0, 'pgrefill': 0, 'pgscan': 0, 'pgsteal': 0, 'shmem': 0, 'slab': 0, 'slab_reclaimable': 0, 'slab_unreclaimable': 0, 'sock': 0, 'thp_collapse_alloc': 0, 'thp_fault_alloc': 0, 'unevictable': 0, 'workingset_activate': 0, 'workingset_nodereclaim': 0, 'workingset_refault': 0}}
[Docker] WatchTower: Raw 'memory_stats' {'stats': {'active_anon': 0, 'active_file': 0, 'anon': 0, 'anon_thp': 0, 'file': 0, 'file_dirty': 0, 'file_mapped': 0, 'file_writeback': 0, 'inactive_anon': 0, 'inactive_file': 0, 'kernel_stack': 0, 'pgactivate': 0, 'pgdeactivate': 0, 'pgfault': 0, 'pglazyfree': 0, 'pglazyfreed': 0, 'pgmajfault': 0, 'pgrefill': 0, 'pgscan': 0, 'pgsteal': 0, 'shmem': 0, 'slab': 0, 'slab_reclaimable': 0, 'slab_unreclaimable': 0, 'sock': 0, 'thp_collapse_alloc': 0, 'thp_fault_alloc': 0, 'unevictable': 0, 'workingset_activate': 0, 'workingset_nodereclaim': 0, 'workingset_refault': 0}}

I have to add that the containers listed in the error messages are only 5 out of 9 that I currently have running. So does it possibly have something to do with the containers themselves?

ualex73 commented 2 months ago

What do you see when you run "docker stats"?

I got also a container which does not show it normally (see "squid"): 9d4acd5ed618 smokeping 0.01% 67.56MiB / 9.878GiB 0.67% 994MB / 998MB 236MB / 15GB 20 c353ad7f52ea portainer 0.00% 28MiB / 9.878GiB 0.28% 3.92GB / 158MB 77.8MB / 7.3GB 7 c2f9195c319f squid 0.00% 0B / 0B 0.00% 0B / 0B 0B / 0B 0 31a65faf725b nzbget 0.04% 3.906MiB / 9.878GiB 0.04% 136kB / 0B 14.7MB / 401kB 16

z-master42 commented 2 months ago
CONTAINER ID   NAME                   CPU %     MEM USAGE / LIMIT   MEM %     NET I/O           BLOCK I/O         PIDS
ba434da19e5f   Prometheus             0.04%     0B / 0B             0.00%     135MB / 16MB      111MB / 0B        11
67da12cda0ed   RTSP                   0.00%     0B / 0B             0.00%     139kB / 0B        24.8MB / 0B       10
4b3e4ca89a75   SolarFlow-Statuspage   0.08%     0B / 0B             0.00%     15.4MB / 11.7MB   532kB / 0B        3
53ce8dc221ab   Pi-hole                0.68%     0B / 0B             0.00%     217MB / 142MB     1.25GB / 3.04MB   44
56065c3b735c   Go2RTC                 0.01%     0B / 0B             0.00%     12.3MB / 13.4MB   37.4MB / 0B       12
fcb483d8b6e6   portainer              0.00%     0B / 0B             0.00%     3.28MB / 16.1MB   110MB / 0B        8
03370429d3db   WatchTower             0.00%     0B / 0B             0.00%     1.66MB / 502kB    46.3MB / 770kB    10
16bf6602049d   etesync-dav            0.00%     0B / 0B             0.00%     11.5MB / 50.7MB   175MB / 0B        3
ualex73 commented 2 months ago

If you are running raspberry pi or Ubuntu/debian, check the README, there is a config fix you can apply.

z-master42 commented 2 months ago

Damn. I'm sure I read that, but I couldn't remember or didn't make the connection.

Thanks for your time.

By the way: For Raspberry, the path is now boot/firmware/cmdline.txt.