![如何通过 Glances 显示 Podman 容器统计信息?](https://linux22.com/image/1031130/%E5%A6%82%E4%BD%95%E9%80%9A%E8%BF%87%20Glances%20%E6%98%BE%E7%A4%BA%20Podman%20%E5%AE%B9%E5%99%A8%E7%BB%9F%E8%AE%A1%E4%BF%A1%E6%81%AF%EF%BC%9F.png)
我通过 pip 安装了 Glances,但它没有显示 Podman 容器。但是,当我使用 sudo 运行 Glances 时,会显示 Docker 容器。Docker 以 root 身份运行,Podman 以无 root 身份运行。我将 Glances.conf [containers] 部分更改为:
[containers]
disable=False
# Only show specific containers (comma separated list of container name or regular expression)
# Comment this line to display all containers (default configuration)
#show=telegraf
# Hide some containers (comma separated list of container name or regular expression)
# Comment this line to display all containers (default configuration)
#hide=telegraf
# Define the maximum docker size name (default is 20 chars)
max_name_size=20
#cpu_careful=50
# Thresholds for CPU and MEM (in %)
cpu_warning=70
cpu_critical=90
#mem_careful=20
mem_warning=50
mem_critical=70
#
# Per container thresholds
#containername_cpu_careful=10
#containername_cpu_warning=20
#containername_cpu_critical=30
#
# By default, Glances only display running containers
# Set the following key to True to display all containers
all=True
# Define Podman sock
podman_sock=unix:///run/user/1000/podman/podman.sock
我确认此配置文件中的更改有效。我的 podman 套接字的路径是否不正确?我如何找到我的 podman 套接字?
答案1
你确定你启动了 podman socket 吗?你可以通过运行来验证systemctl --user status podman.socket
。如果你想启动 socket,只需运行systemctl --user start podman.socket