1
0
mirror of https://github.com/shirou/gopsutil.git synced 2025-05-08 19:29:25 +08:00

59 Commits

Author SHA1 Message Date
Marco Pfatschbacher
b4846b445b Add support for OpenBSD/amd64
This code is based on the FreeBSD version
and implements roughly the same feature set.
2016-11-24 22:30:29 +01:00
Cameron Sparr
5af5f08785 Fix NetIOCounter windows interface behavior
addresses a few things:

- Windows has a concept of both a network "interface" and an "adapter"
- These are almost always a one-to-one relationship, though there can be
esoteric instances where they are not.
- I believe the gopsutil NetIOCounters function should only return on a
per-interface level, since this is the behavior on linux/darwin.

Previously, the plugin was basically ignoring the actual interfaces
returned from net.Interfaces(). Instead, it was looping over the net
adapters for each interface, somewhat uselessly.

FWIW, the code for getAdapterList() doesn't exist in the Go standard lib
anymore.

closes #245
2016-10-25 16:51:40 +01:00
Jean Kahrs
e004ef15e1 remove unused code 2016-10-11 10:34:47 +02:00
Jean Kahrs
d6f5a9e920 fix net_test.go 2016-10-06 15:46:14 +02:00
Jean Kahrs
98a0a30dca update test 2016-10-06 15:38:56 +02:00
Jean Kahrs
ab24c97439 break import cycle 2016-10-06 15:32:25 +02:00
Jean Kahrs
cba0992ab3 add Uids field to net_linux 2016-10-06 14:50:03 +02:00
Bruno Clermont
3f96312057 only run ifconfig/netstat if necessary, add some tests 2016-09-04 16:37:28 +02:00
Bruno Clermont
145e48efdb actually there is 13 columns, not 12 2016-08-31 20:41:42 +02:00
Bruno Clermont
57ffe3b1ef Support interface with multiple digits 2016-08-31 20:41:11 +02:00
Lukas Fittl
da9fa1162b Add fallback code for all unsupported operating systems.
This enables using gopsutil in a codebase that gets built on other OSes
than the ones supported. Instead of a build failure as before, due to
the build tags, gopsutil will now throw an "not implemented" runtime
error.

Fixes #234.
2016-08-22 15:31:26 -07:00
sandlbn
480ccb89e1 Added support for linux net interface fifo errors 2016-06-13 13:27:25 +01:00
Shirou WAKAYAMA
57f6aebc7e add Timeout to invoke command and use common.Invoke refs: #201 2016-05-20 17:59:41 +09:00
Shirou WAKAYAMA
bce9212def fix build bugs. 2016-04-01 22:22:03 +09:00
Shirou WAKAYAMA
613a8a90e1 fixed by golint. 2016-04-01 21:34:39 +09:00
Shirou WAKAYAMA
4bb84648bf JSON representation is renamed to fit Google JSON style, camelCase. 2016-03-23 10:52:46 +09:00
Shirou WAKAYAMA
ea152ea901 [BREAKING CHANGE] rename functions to pass golint. ex) net.NetIOCounters -> net.IOCounters 2016-03-22 23:09:12 +09:00
Shirou WAKAYAMA
1f32ce1bb3 [net]linux: skip if "/proc/sys/net" is not exists on test environment. 2016-03-15 22:47:56 +09:00
Shirou WAKAYAMA
34b63e671b [net]linux: add a test and fix private field name. 2016-03-10 22:32:16 +09:00
Shirou WAKAYAMA
567da004c5 [net]linux: explicit skip CI. 2016-03-06 00:02:06 +09:00
Shirou WAKAYAMA
32fa88eb49 [net]linux: TestGetProcInodes will fail on CI. 2016-03-05 23:57:18 +09:00
Shirou WAKAYAMA
31439aa6b5 [net]linux: fix valious bugs in NetConnections. 2016-03-05 23:53:32 +09:00
Shirou WAKAYAMA
e4ddff09d5 [net]linux: add process_unix for NetConnections. 2016-03-05 22:24:26 +09:00
Shirou WAKAYAMA
32c62b5d48 [net]linux: implement processInet(). 2016-03-04 23:42:22 +09:00
Shirou WAKAYAMA
6c352016d8 [net]linux: start replacing lsof. still work in progress. 2016-03-01 23:38:13 +09:00
Shirou WAKAYAMA
d680853370 net,process[linux]: add process.NetIOCounter and net.NetIOCounterByFile. 2016-01-21 17:31:05 +09:00
Masayoshi Sekimura
3a1fa5dc80 format go program with go 1.5.2 "go fmt" 2016-01-09 16:17:21 -08:00
shirou
f58654fa1c Merge pull request #122 from jimmystewpot/add_netfilter
Add nf_conntrack counter support
2015-12-16 15:32:43 +09:00
Cameron Sparr
432bcbd056 Add -W flag to netstat on BSD systems
This prevents netstat from truncating the interface name to 5
characters. See https://github.com/influxdb/telegraf/issues/438
2015-12-15 08:27:15 -07:00
shirou
dc452207f2 Merge pull request #128 from ontsysmattholcomb/use-env-proto-counters
using HostProc for protocounters in linux
2015-12-14 21:44:25 +09:00
Nikolay Sivko
906df3ed85 [net] fix panic on freebsd (netstat error with exit code 0) 2015-12-11 14:47:48 +03:00
Matt Holcomb
21ccfe6b60 using HostProc for protocounters in linux 2015-12-10 16:37:36 +00:00
James Lamb
a9e946c7dd change the snakecase to reflect the files being read 2015-12-09 07:49:20 +11:00
James Lamb
5700150054 Updated README.rst and included updated syntax to be more uniform with the other code 2015-12-09 07:45:26 +11:00
James Lamb
22f35fd518 add netfilter counter support 2015-12-08 09:32:45 +11:00
James Lamb
dfff8af4df add nf_conntrack statistics to net_linux to query iptables/netfilter conntrack limits 2015-12-07 16:56:02 +11:00
Nathaniel Cook
da832b3f12 add system wide network protocol stats 2015-11-20 10:17:21 -07:00
Shirou WAKAYAMA
7288e9a5af common[all]: add internal 2015-10-20 00:04:57 +09:00
Daniel Theophanes
0af895258e common: rename package common to internal/common. Add ENV helper funcs.
Package common wasn't used for public functions. Place it in an
internal directory to prevent other packages from using.

Remove the distributed references to "HOST_PROC" and "HOST_SYS"
consts and combine into a common function. This also helps so that
if a env var is defined with a trailing slash all will continue to
work as expected.

Fixes #100
2015-10-18 20:40:01 -07:00
Jonathan Chauncey
0461c50666 chore(*): Fixes #94
Added the ability to fetch an alternative location for /proc via an
environment variable. If the env var is not set it will return /proc as
the default value.
2015-10-17 11:34:41 -06:00
Shirou WAKAYAMA
93e226a5e3 net[freebsd,linux,darwin]: merge unix like OSes. 2015-10-11 21:57:53 +09:00
Shirou WAKAYAMA
34195b4b58 net[darwin, linux]: get UDP information when inet or all specified. 2015-10-11 21:48:48 +09:00
Shirou WAKAYAMA
b3cf7354f6 process[linux, darwin]: implements Connections using lsof. 2015-09-18 13:36:13 +09:00
Shirou WAKAYAMA
4d0f737301 net: because lsof failed on drone.io, skip TestNetConnections if CI. 2015-09-16 16:33:07 +09:00
Shirou WAKAYAMA
0062ae2bfa use LookPath 2015-09-16 16:27:19 +09:00
Shirou WAKAYAMA
249a761b81 net[linux]: temporary enable error print. 2015-09-16 16:24:04 +09:00
Shirou WAKAYAMA
8d21be591e net[linux]: implements NetConnections() using lsof. 2015-09-16 16:20:07 +09:00
Shirou WAKAYAMA
c50db4f462 net[darwin]: implement NetConnections(). 2015-09-16 16:13:00 +09:00
Shirou WAKAYAMA
6bb6762470 net[darwin]: add drop count to NetIOCounter. 2015-09-11 12:18:33 +09:00
Shirou WAKAYAMA
e0b1d62a4d net[darwin]: add netstat -idbn example in the comment. 2015-09-11 11:24:03 +09:00