{"action":"created","issue":{"url":"https://api.github.com/repos/shirou/gopsutil/issues/254","repository_url":"https://api.github.com/repos/shirou/gopsutil","labels_url":"https://api.github.com/repos/shirou/gopsutil/issues/254/labels{/name}","comments_url":"https://api.github.com/repos/shirou/gopsutil/issues/254/comments","events_url":"https://api.github.com/repos/shirou/gopsutil/issues/254/events","html_url":"https://github.com/shirou/gopsutil/pull/254","id":174054832,"number":254,"title":"OSX Workaround: support interface with multiple digits","user":{"login":"bclermont","id":474302,"avatar_url":"https://avatars.githubusercontent.com/u/474302?v=3","gravatar_id":"","url":"https://api.github.com/users/bclermont","html_url":"https://github.com/bclermont","followers_url":"https://api.github.com/users/bclermont/followers","following_url":"https://api.github.com/users/bclermont/following{/other_user}","gists_url":"https://api.github.com/users/bclermont/gists{/gist_id}","starred_url":"https://api.github.com/users/bclermont/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bclermont/subscriptions","organizations_url":"https://api.github.com/users/bclermont/orgs","repos_url":"https://api.github.com/users/bclermont/repos","events_url":"https://api.github.com/users/bclermont/events{/privacy}","received_events_url":"https://api.github.com/users/bclermont/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-08-30T15:44:45Z","updated_at":"2016-09-04T14:39:27Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/shirou/gopsutil/pulls/254","html_url":"https://github.com/shirou/gopsutil/pull/254","diff_url":"https://github.com/shirou/gopsutil/pull/254.diff","patch_url":"https://github.com/shirou/gopsutil/pull/254.patch"},"body":"On OSX, `netstat -ibdnW` strip every digits out of interface name, if it's more than a single digit. example:\r\n\r\n```\r\n$ ifconfig -a\r\nlo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384\r\n       \toptions=3<RXCSUM,TXCSUM>\r\n       \tinet6 ::1 prefixlen 128\r\n       \tinet 127.0.0.1 netmask 0xff000000\r\n       \tinet6 fe80::1%lo0 prefixlen 64 scopeid 0x1\r\n       \tnd6 options=1<PERFORMNUD>\r\ngif0: flags=8010<POINTOPOINT,MULTICAST> mtu 1280\r\nstf0: flags=0<> mtu 1280\r\nutun81: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1500\r\nutun83: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1500\r\nutun85: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1500\r\nutun86: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1500\r\nutun88: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 1500\r\n``` \r\n\r\nand the output of `netstat`:\r\n\r\n```\r\n$ netstat -ibdnW\r\nName  Mtu   Network       Address            Ipkts Ierrs     Ibytes    Opkts Oerrs     Obytes  Coll Drop\r\nlo0   16384 <Link#1>                         31241     0    3769823    31241     0    3769823     0   0\r\nlo0   16384 ::1/128     ::1                  31241     -    3769823    31241     -    3769823     -   -\r\nlo0   16384 127           127.0.0.1          31241     -    3769823    31241     -    3769823     -   -\r\nlo0   16384 fe80::1%lo0 fe80:1::1            31241     -    3769823    31241     -    3769823     -   -\r\ngif0* 1280  <Link#2>                             0     0          0        0     0          0     0   0\r\nstf0* 1280  <Link#3>                             0     0          0        0     0          0     0   0\r\nutun8 1500  <Link#88>                          286     0      27175        0     0          0     0   0\r\nutun8 1500  <Link#90>                          286     0      29554        0     0          0     0   0\r\nutun8 1500  <Link#92>                          286     0      29244        0     0          0     0   0\r\nutun8 1500  <Link#93>                          286     0      28267        0     0          0     0   0\r\nutun8 1500  <Link#95>                          286     0      28593        0     0          0     0   0\r\n```\r\n\r\nAll those 5 interfaces `utun8*` are considered as only `utun8` and only one is really processed.\r\n\r\nThis change use `ifconfig -l` first to list all interfaces, and then invoke `netstat` for each of them.\r\n\r\nSlower, but it works."},"comment":{"url":"https://api.github.com/repos/shirou/gopsutil/issues/comments/244607085","html_url":"https://github.com/shirou/gopsutil/pull/254#issuecomment-244607085","issue_url":"https://api.github.com/repos/shirou/gopsutil/issues/254","id":244607085,"user":{"login":"bclermont","id":474302,"avatar_url":"https://avatars.githubusercontent.com/u/474302?v=3","gravatar_id":"","url":"https://api.github.com/users/bclermont","html_url":"https://github.com/bclermont","followers_url":"https://api.github.com/users/bclermont/followers","following_url":"https://api.github.com/users/bclermont/following{/other_user}","gists_url":"https://api.github.com/users/bclermont/gists{/gist_id}","starred_url":"https://api.github.com/users/bclermont/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bclermont/subscriptions","organizations_url":"https://api.github.com/users/bclermont/orgs","repos_url":"https://api.github.com/users/bclermont/repos","events_url":"https://api.github.com/users/bclermont/events{/privacy}","received_events_url":"https://api.github.com/users/bclermont/received_events","type":"User","site_admin":false},"created_at":"2016-09-04T14:39:27Z","updated_at":"2016-09-04T14:39:27Z","body":"I changed the logic to make itself figure if interface name had been truncated or not. and it will run ifconfig and netstat to get the stats of only the interfaces that was truncated.\r\n\r\nI couldn't figure a more simple implementation"}}
{"actor":{"display_login":"bclermont"}}