Commit Graph

211 Commits (511da82e944b7761e2cdccdcf2123b2517d3a79b)

Author SHA1 Message Date
Matthieu MOREL 4671e649aa
enable revive linter 3 years ago
mmorel-35 1e6b445a8a gofumpt 3 years ago
mmorel-35 eb5f6203d8 gofmt 3 years ago
shirou b1186a68ed
Merge pull request #1191 from shirou/feature/update_mac_cgo
[disk][host][mac] fix deprecated code in macOS Monterey
3 years ago
Matthieu MOREL b673968d5d
enable errorlint linter 3 years ago
shirou 4c3edcfe56 [mac] fix deprecated code in macOS Monterey 3 years ago
shirou d2e27c1712 fix dependabot v2 deletion. 3 years ago
shirou 0969c9436b delete v2 directory, move v3 to top #1078 3 years ago
shirou 0fdf65fa3e Change to use yusufpapurcu/wmi from StackExchange/wmi. 3 years ago
shirou e032a1c81d
Merge pull request #1059 from d1ss0nanz/issue1058
use ioreg to read IOPlatformUUID as HostID
3 years ago
Lars Meyer a7d936d0a4 [host][windows] Fix Windows 11 reporting
While ProductName remains "Windows 10", versions with Build no. >= 22000
are Windows 11.
3 years ago
odinje a3e22baec0 Ensure rhel platform family for Rocky Linux 4 years ago
shirou 2782a109dc
Merge pull request #1010 from gdbinit/openbsd-wrong-users-number-patch
Fix wrong OpenBSD user count
4 years ago
Daniel Stutz 9916462c47 use ioreg to read IOPlatformUUID as HostID 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