Commit Graph

198 Commits (b49f37e9f30f49530cf2ad6038a4dac1b746c8f7)

Author SHA1 Message Date
shirou 2782a109dc
Merge pull request #1010 from gdbinit/openbsd-wrong-users-number-patch
Fix wrong OpenBSD user count
4 years ago
Guillaume Ballet 992d17af94 add support for OpenBSD arm64 4 years ago
Mykola Terelia 84e8e51bf9 Added missing distributions to the suse platform family 4 years ago
fG! ab33d5ec89
Fix wrong user count
There are empty entries in OpenBSD's utmp that have a line and time entry but no user logged in (the entry is "cleared" after user logs out but not totally as expected in the code here). Current checks are insufficient so check if Name field is empty and skip in that case.
4 years ago
shirou f377a07e5a fix test and openbsd errors. 4 years ago
Ryan Fitzpatrick 8046134504
Fix VirtualizationWithContext() race in linux 5 years ago
shirou 6c9f3bdcae [host][linux] Change to use unix.SysInfo_t to get Uptime in Linux 5 years ago
Sergey Vinogradov 5209442b3c Refactor "host" package 5 years ago
Lomanic 8a625ec054 [host][process][darwin] Go-fmt code from mktypes.sh from #917 5 years ago
Lomanic 2e4fcbb8c4
Merge pull request #917 from amdprophet/darwin-arm64
Add support for Darwin/ARM64
5 years ago
Lomanic 4cfc60d68b
Merge pull request #928 from Lomanic/skip-tests-when-not-implemented 5 years ago
Lomanic e1925b853e
Merge pull request #935 from Lomanic/issue900
[linux] Fix #900, skip or fix failing tests in docker
5 years ago
Lomanic 1b3e0c6643 [linux] Fix #900, skip or fix failing tests in docker
TestGetProcInodesAll: create a server so there are some opened inodes
TestUsers: skip if Users is empty, because of an empty /var/run/utmp
Test_Process_Groups: skip if Groups is empty
TestConnectionsMax: skip on CI, not only CircleCI
5 years ago
Lomanic 84afaae670 [host][mem][process][openbsd] Add 386 const and types definitions
Continuation of #721, this type using mktypes.sh that I didn't know at the time.
Weirdly, `go tool cgo -godefs` doesn't produce propery go-fmt-ed code, had to do run go-fmt manually afterwards.
5 years ago
Lomanic 8110480793 [host] Skip tests on non-implemented platforms #446 5 years ago
Justin Kolberg 53ffb0cece Add support for Darwin/ARM64
Signed-off-by: Justin Kolberg <amd.prophet@gmail.com>
5 years ago
Tobias Klauser 28890b0482 Use common implementation for BootTime/Uptime on all BSDs
All BSDs use the same implementation to get BootTime{,WithContext} and
Uptime{,WithContext} based on the kern.boottime sysctl. Move this
implementation to a separate host/host_bsd.go file shared by darwin,
freebsd and openbsd. Also use SysctlTimeval to get
the boot time directly as a type Timeval instead of manually
extracting it using package unsafe. It will also allow for easier reuse
to support package host on e.g. Dragonfly BSD or NetBSD.

This requires updating the golang.org/x/sys/unix dependency to the
latest revision.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
5 years ago
Tobias Klauser 1e61ed79fa host: add support for linux/riscv64 5 years ago
Lomanic 42c6875555 [host][darwin][cgo] Fix #832 work around once-again broken go modules not including C files
Supersedes #885 by @afontaine
5 years ago
shirou a81cf97fce
Merge pull request #861 from Lomanic/issue391
[host][linux] Fix #391 retrieve sensors temps on OSes lacking hwmon
5 years ago
Tobias Klauser 7bee6a934d host: fix TestHostInfoStat_String
TestHostInfoStat_String has been broken since kernelArch has been
introduced. Fix it.

Also adjust the error message to show the wanted string, aligned with
the gotten string so it's easier to spot differences.
5 years ago
Tim Gross c69ef749eb fix host.Info() panic if /etc/debian_version is empty
The ReadLines helper function doesn't guarantee that the length of
lines is non-zero or that the lines have contents. Most callers
include a check for length but this was missing for version
fingerprinting on Debian if `/etc/debian_version` was empty, leading
to a panic.
5 years ago
shirou f4fc0580b8
Merge pull request #802 from dmgk/master
Add support for freebsd/arm64
5 years ago
Dmitri Goutnik 270f6afc22
Add support for freebsd/arm64 5 years ago
Alessandro De Angelis b7ac341eac fix compilation warnings 5 years ago
Alessandro De Angelis 65a2e0e9bb Restored temperature info for macOS 5 years ago
Lomanic c58a1e8ec7 [host][linux] Fix #391 retrieve sensors temps on OSes lacking hwmon 6 years ago
Aman Gupta 25be4d08fe
Trim null bytes from kernel arch 6 years ago
Aman Gupta 62a406ec1b
Trim null bytes from kernel version 6 years ago
shirou 8a5bcfdb53
Merge pull request #739 from Lomanic/issue738
[host][linux] Fix #738 use uname syscall to get version in KernelVersion()
6 years ago
Lomanic 4bf185067d [host] Fix #737 add KernelArch field in InfoStat struct returning 'uname -m' result 6 years ago
Lomanic 98c779765f [host] go-fmt and propagate context on Windows in Info() 6 years ago
Lomanic 8c28c3ba17 [host][linux] Fix #738 use uname syscall to get version in KernelVersion() 6 years ago
Lomanic 9219f16f03 [host][linux] Fix #340 return Solus OS as from the "solus" PlatformFamily in Info() 6 years ago
WAKAYAMA shirou 669b2710bf [freebsd]host: change freebsd struct for 386 and arm. 6 years ago
WAKAYAMA shirou 2fd3f03f84 [freebsd][host]: fix Users() return start secs. 6 years ago
shirou a83baef6e4
Merge pull request #698 from picatz/fix-platformFamily-on-macOS
Update host_darwin.go
6 years ago
shirou 7c2ac48f84
Merge branch 'master' into td-remove-cycle 6 years ago
shirou 3d9d5e60ef
Merge pull request #688 from asnowfox/master
use /proc/buc/pci/devices to identify a VM is a guest
6 years ago
shirou d8686bcd5c
Merge pull request #675 from marcv81/fix_665_v2
Fix for #665
6 years ago
Kent 'picat' Gruber e507f44421 Update host_darwin.go
Copy+pasta got me again! 🍝

No new variable on the left of `:=` 😂
6 years ago
Kent 'picat' Gruber d13ba02ef0 Update host_darwin.go
The /System/Library/CoreServices/ServerVersion.plist exists on macOS servers , but not on a workstation such as my laptop. The actual terminoly is mostly borrowed from the windows equivalent as @Lomanic suggested. In theory, this should make interpreting the results from the two platforms a bit more consistent.

Note: The macOS server application can be installed on almost any macOS workstation to make it a server that can manage other apple devices.
6 years ago
Lomanic 3af6e1ffe7 [host][linux] Properly handle double quotes in /etc/os-release in PlatformInformation 6 years ago
Arturo Reuschenbach Puncernau 2a0b67d19c added sles to the suse platform family 6 years ago
Tyler Dixon a02925055c Remove cycle between process and host packages
gopsutil is a transitive dependency of another project that I am integrating
into an internal build system. We target multiple platforms and as a part
of the build system for the large internal repo, we calculate the build
graph used to determine what targets have changed and need to be build /
tested as a single DAG for all platforms.

gopsutil currently does not form a DAG if linux and any other platform are
considered at the same time. linux is the only platform where the process
package imports the host package.

To remove this cycle, the relevant methods have been moved to internal/common
with the linux build tag and are consumed the host and process packages.
6 years ago
litong 6dfd8d56bb Merge branch 'master' of https://github.com/asnowfox/gopsutil 6 years ago
litong 119f26c1df use bus/pci/devices to identify a vm guest 6 years ago
Snow Fox 0cad0faa11
Merge pull request #1 from shirou/master
merge master
6 years ago
litong 12005ab922 use /proc/bus/pci/devices to idenetify a kvm guest 6 years ago
Segflow 86c7289ccc Fix: use filename in exec.LookPath instead of full path
exec.LookPath searches for the file in the $PATH, which mean giving it an absolute path is against it's own purposes.
6 years ago