我通过 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