Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HDD Temps inside docker container? #1195

Open
jtpavlock opened this issue Dec 1, 2017 · 3 comments
Open

HDD Temps inside docker container? #1195

jtpavlock opened this issue Dec 1, 2017 · 3 comments

Comments

@jtpavlock
Copy link

Description

Is there anyway currently to get hdd temps while glances is running inside of a docker container?

Maybe I'm bad at searching, but I couldn't find anything / could use some help if this is possible.

Versions

  • Glances (glances -V): current docker container image
  • PSutil (glances -V):
  • Operating System (lsb_release -a): Debian 9.2
@nicolargo
Copy link
Owner

Not an easy trick...

Glances uses a socket connection to the HDDTemp daemon running on the host (by default on 127.0.0.1:7634). So you had to :

  1. configure your HDDTemp daemon to listen to all interfaces
  2. find a way to map this host local port inside the Glances container

If a contributor has an idea...

@dalberto
Copy link

So I think this should be possible:

  1. hddtemp has --listen option that would allow listening on all interfaces.
  2. It is possible for a container to access services on the hosts but the address is different based on whether Docker is running natively or not (i.e. Docker for Mac / Windows). This seems like a simple wrapper script that can handle the differences though: https://github.com/bufferings/docker-access-host

@wxhbts
Copy link

wxhbts commented Apr 12, 2023

docker increase --net=host

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 --net=host --name glances nicolargo/glances:latest-full

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants