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

Cant see user name when run netdata in docker #5585

Closed
luanmingyi opened this issue Mar 8, 2019 · 6 comments · Fixed by #6472
Closed

Cant see user name when run netdata in docker #5585

luanmingyi opened this issue Mar 8, 2019 · 6 comments · Fixed by #6472
Assignees
Labels
area/collectors Everything related to data collection bug docker docker related issues priority/medium
Milestone

Comments

@luanmingyi
Copy link

Question summary

I run netdata in docker, the user names in the "per user statistics" under Users tag are not shown, instead it shows the user id (except for root netdate xfs). I want see the user name in the legand.

It looks like the problem is about docker not netdata, but i search it on google and fail to solve it.

below is my docker-composer file:

version: "3"
services:
  netdata:
    image: netdata/netdata
    ports:
      - 19999:19999
    cap_add:
      - SYS_PTRACE
    environment:
      - PGID=999
    security_opt:
      - apparmor:unconfined
    volumes:
      - /proc:/host/proc:ro
      - /sys:/host/sys:ro
      - /var/run/docker.sock:/var/run/docker.sock:ro
    restart: always
OS / Environment

ubuntu 18.04
docker 18.09.3

@luanmingyi luanmingyi changed the title Cant see user name when run netdata in docker Cant see user name when run netdata in docker ❓ Mar 8, 2019
@luanmingyi luanmingyi changed the title Cant see user name when run netdata in docker ❓ question: Cant see user name when run netdata in docker Mar 8, 2019
@netdatabot netdatabot added no changelog Issues which are not going to be added to changelog question labels Mar 9, 2019
@luanmingyi luanmingyi changed the title question: Cant see user name when run netdata in docker Cant see user name when run netdata in docker Mar 9, 2019
@stale
Copy link

stale bot commented Apr 23, 2019

Currently netdata team doesn't have enough capacity to work on this issue. We will be more than glad to accept a pull request with a solution to problem described here. This issue will be closed after another 60 days of inactivity.

@stale stale bot added the stale label Apr 23, 2019
@stale stale bot removed the stale label Apr 29, 2019
@cakrit
Copy link
Contributor

cakrit commented Apr 29, 2019

@vlvkobal any suggestions on this one?

@vlvkobal
Copy link
Contributor

vlvkobal commented May 8, 2019

We use getpwuid() call to get user names that's why the information is retrieved from /etc/passwd inside the docker container. To do this the right way we need to read the file itself and mount the host's file to the container under /host/etc/passwd.

@vlvkobal vlvkobal added area/collectors Everything related to data collection bug priority/low A 'nice to have' not critical issue and removed no changelog Issues which are not going to be added to changelog question labels May 8, 2019
@luanmingyi
Copy link
Author

We use getpwuid() call to get user names that's why the information is retrieved from /etc/passwd inside the docker container. To do this the right way we need to read the file itself and mount the host's file to the container under /host/etc/passwd.

volumes:

  • /proc:/host/proc:ro
  • /sys:/host/sys:ro
  • /etc:/host/etc:ro
  • /var/run/docker.sock:/var/run/docker.sock:ro

I modify the docker-composer file as above, but does not work.

@vlvkobal
Copy link
Contributor

vlvkobal commented May 8, 2019

getpwuid() knows nothing about /host/etc/passwd. So, we need to modify apps.plugin to make it read the correct information.

@Zciwobukaj
Copy link

Any news on this issue ? I too would like see user name instead of ID.

@vlvkobal vlvkobal added priority/medium and removed priority/low A 'nice to have' not critical issue labels Jul 4, 2019
@vlvkobal vlvkobal added this to the v1.17-rc1 milestone Jul 4, 2019
@vlvkobal vlvkobal added the size:3 label Jul 4, 2019
@ilyam8 ilyam8 added the docker docker related issues label May 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/collectors Everything related to data collection bug docker docker related issues priority/medium
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants