{"action":"created","issue":{"url":"https://api.github.com/repos/sflow/host-sflow/issues/15","repository_url":"https://api.github.com/repos/sflow/host-sflow","labels_url":"https://api.github.com/repos/sflow/host-sflow/issues/15/labels{/name}","comments_url":"https://api.github.com/repos/sflow/host-sflow/issues/15/comments","events_url":"https://api.github.com/repos/sflow/host-sflow/issues/15/events","html_url":"https://github.com/sflow/host-sflow/issues/15","id":185396904,"number":15,"title":"Missing docker vir_* metrics when using hsflowd as a container","user":{"login":"moss2k13","id":4396381,"avatar_url":"https://avatars.githubusercontent.com/u/4396381?v=3","gravatar_id":"","url":"https://api.github.com/users/moss2k13","html_url":"https://github.com/moss2k13","followers_url":"https://api.github.com/users/moss2k13/followers","following_url":"https://api.github.com/users/moss2k13/following{/other_user}","gists_url":"https://api.github.com/users/moss2k13/gists{/gist_id}","starred_url":"https://api.github.com/users/moss2k13/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moss2k13/subscriptions","organizations_url":"https://api.github.com/users/moss2k13/orgs","repos_url":"https://api.github.com/users/moss2k13/repos","events_url":"https://api.github.com/users/moss2k13/events{/privacy}","received_events_url":"https://api.github.com/users/moss2k13/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-10-26T13:42:07Z","updated_at":"2016-10-26T18:13:56Z","closed_at":null,"body":"Hello,\r\nI'm trying to use hsflowd as a container on coreos using this [Dockerfile](https://gist.githubusercontent.com/moss2k13/a94bd79dc2e5438d16279ac8c636e68f/raw/1e8edfe494a3d5e3e9dd7064e0ac9cc802e7a41d/Dockerfile)\r\n\r\nHsflowd package `hsflowd-ubuntu16_2.0.5-7_amd64.deb` has been built (commit f7bcfac) by running:\r\n```\r\nsudo ./docker_build_on ubuntu16\r\n```\r\nI'm using below command to start the containers:\r\n```\r\n/usr/bin/docker run --cap-add=NET_ADMIN --pid=host --uts=host --net=host \\\r\n-v /var/run/docker.sock:/var/run/docker.sock -v /sys/fs/cgroup/:/sys/fs/cgroup/:ro \\\r\n--name hsflowd hsflowd\r\n```\r\nI don't have vir_* metrics available in sflow-rt from hsflowds running as a container:\r\n```\r\ncore@core-1 ~ $ curl http://localhost:8008/dump/10.x.x.81/ALL/json|grep metricName|grep vir\r\ncore@core-1 ~ $ curl http://localhost:8008/dump/10.x.x.82/ALL/json|grep metricName|grep vir\r\ncore@core-1 ~ $ curl http://localhost:8008/dump/10.x.x.83/ALL/json|grep metricName|grep vir\r\n```\r\nI see them from hsflowd on normal ubuntu vm:\r\n```\r\ncore@core-1 ~ $ curl http://localhost:8008/dump/10.x.x.84/ALL/json|grep metricName|grep vir|wc -l\r\n140\r\n```\r\nI attached hsflowd logs from both (container and vm) below:\r\n\r\n- [hsflowd_from_standard_ubuntu_vm.log (10.x.x.84)](https://gist.github.com/moss2k13/7bf6ee39d58e41323670fee2064b2f75)\r\n\r\n- [hsflowd_from_container.log (10.x.x.81)](https://gist.github.com/moss2k13/735fca569864b9151ef0b0baaaff4f3f)\r\n\r\nI have other containers running on nodes 10.x.x.81-83 where I use hsflowd as a container:\r\n```\r\ncore@core-1 ~ $ dkc\r\nCONTAINER ID        IMAGE                    COMMAND                  CREATED             STATUS              PORTS                                            NAMES\r\nb0f75c9f95fa        nginx                    \"nginx -g 'daemon off\"   58 minutes ago      Up 58 minutes       80/tcp, 443/tcp                                  awesome_sammet\r\nc7467a33eb0b        localhost:5000/hsflowd   \"/bin/sh -c '/etc/ini\"   About an hour ago   Up About an hour                                                     hsflowd\r\nc88f6c3dca15        sflow/sflow-rt           \"/sflow-rt/start.sh\"     7 hours ago         Up 7 hours          0.0.0.0:6343->6343/udp, 0.0.0.0:8008->8008/tcp   fervent_brattain\r\nc12de84bf3cb        registry:2               \"/entrypoint.sh /etc/\"   26 hours ago        Up 26 hours         127.0.0.1:5000->5000/tcp                         registry\r\ncore@core-1 ~ $ dke -it hsflowd bash\r\n\r\nroot@core-1:/# export DOCKER_API_VERSION=1.22\r\n\r\nroot@core-1:/# docker ps\r\nCONTAINER ID        IMAGE                    COMMAND                  CREATED             STATUS              PORTS                                            NAMES\r\nb0f75c9f95fa        nginx                    \"nginx -g 'daemon off\"   58 minutes ago      Up 58 minutes       80/tcp, 443/tcp                                  awesome_sammet\r\nc7467a33eb0b        localhost:5000/hsflowd   \"/bin/sh -c '/etc/ini\"   About an hour ago   Up About an hour                                                     hsflowd\r\nc88f6c3dca15        sflow/sflow-rt           \"/sflow-rt/start.sh\"     7 hours ago         Up 7 hours          0.0.0.0:6343->6343/udp, 0.0.0.0:8008->8008/tcp   fervent_brattain\r\nc12de84bf3cb        registry:2               \"/entrypoint.sh /etc/\"   26 hours ago        Up 26 hours         127.0.0.1:5000->5000/tcp                         registry\r\n```\r\n\r\nI could missed something along the way though\r\n"},"comment":{"url":"https://api.github.com/repos/sflow/host-sflow/issues/comments/256432347","html_url":"https://github.com/sflow/host-sflow/issues/15#issuecomment-256432347","issue_url":"https://api.github.com/repos/sflow/host-sflow/issues/15","id":256432347,"user":{"login":"sflow","id":419447,"avatar_url":"https://avatars.githubusercontent.com/u/419447?v=3","gravatar_id":"","url":"https://api.github.com/users/sflow","html_url":"https://github.com/sflow","followers_url":"https://api.github.com/users/sflow/followers","following_url":"https://api.github.com/users/sflow/following{/other_user}","gists_url":"https://api.github.com/users/sflow/gists{/gist_id}","starred_url":"https://api.github.com/users/sflow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sflow/subscriptions","organizations_url":"https://api.github.com/users/sflow/orgs","repos_url":"https://api.github.com/users/sflow/repos","events_url":"https://api.github.com/users/sflow/events{/privacy}","received_events_url":"https://api.github.com/users/sflow/received_events","type":"User","site_admin":false},"created_at":"2016-10-26T18:13:56Z","updated_at":"2016-10-26T18:13:56Z","body":"At first glance it looks like the initial call to get the list of current containers is successful in that it gets an answer back here:\r\nhttps://gist.github.com/moss2k13/735fca569864b9151ef0b0baaaff4f3f#file-hsflowd_from_container-log-L446-L457\r\n\r\nbut somehow that answer is never processed,  like it is in the non-containerized version here:\r\nhttps://gist.github.com/moss2k13/7bf6ee39d58e41323670fee2064b2f75#file-hsflowd_from_standard_ubuntu_vm-log-L1023-L1223\r\n\r\nAssuming you can't easily run it in the debugger and set breakpoints,  I guess I would add print-statements in places like this to see what might be happening to that request:\r\nhttps://github.com/sflow/host-sflow/blob/master/src/Linux/mod_docker.c#L1199\r\n\r\nMaybe mod_docker is expecting an EVSOCKETREAD_EOF status that never comes?\r\n\r\n(You can see that GET /events answers  are being processed OK,  but those are handled on EVSOCKETREAD_STR.  The GET /containers request is different.  It will accumulate the result until it hits EOF,  and then deliver the whole result at once).\r\n\r\n"}}
{"actor":{"display_login":"sflow"}}