Commit Graph

270 Commits (42957707db5dd49d0bd54fa3cb0152d308a6c8e5)

Author SHA1 Message Date
Aidan 42957707db Return error if hours not in expected format to prevent panic
Aidan 62e5850726 Fixed parsing error where 'day,' is ignored
shirou aca0ba4517 [aix]: move tempereture from host to sensors package.
shirou c34d29a8bf fix: rename v3 that remained in file c to v4
shirou.wakayama 0e9c0ade3c [host][windows]: change platform version from build version to display version
shirou e9591b5b01 rename redundant test function names, such as TestCPU in cpu package
shirou ab0d977709 [sensors] move Temperatures from host to sensors.
shirou bc060cc227 add SPDX License, remove old build tag, and replace import
Dylan Myers ff4ae36cc0 Remove extraneous development note comments
Move a function from nocgo to main file for disk package
Dylan Myers 9bf502f825 Fix logic errors, syntax errors, and typos
Dylan Myers b133d602ce Ignore host_aix_ppc64 for now
Dylan Myers 8df2696709 Account for other possible formats output by AIX uptime command
Dylan Myers 9be5f7d0ad Remove extraneous -1 from users function for AIX
Dylan Myers bd42769f87 Add a working implementation of host.Users() for AIX
Dylan Myers 52d61b8669 Add host support for AIX
shirou cbefbb023e [host][linux]: add pading on linux_arm64
shirou cfb7a5dc2e [host][linux]: change Line/User/Host to int8 on utmp
Generated code is uint8 on arm64. However, it is not same as other archtectures.
This commit changes by hand.
shirou d86a995563 [host][linux]: fix utmp size on linux/arm64
Jonathan Matthew 27ffa28a0d add support for OpenBSD/riscv64
Bryce Kahle b0d976c49b
ensure host platform are files and have contents
In a containerized deployment, it is common to mount several files from /etc. Within the container, those files will be created regardless if they exist on the host or not. In those instances, the existing code would erroneously return empty platform information.
shirou b10acd4894 [host]: add EnableBootTimeCache function
Ville Skyttä 362fa4b9c4 Avoid repeated regexp compilations
Xie Weineng 0de2d14a7c add deepin and uos distro
shirou 4b46f2b70c [host][darwin]: fix Users
Justin Yang 7ffb24dbe3
Merge branch 'shirou:master' into feature/netbsd-arm64-port
Justin Yang 4a46201e00 cpu && host: fix compile time errors
Matthieu MOREL c806740b34
ci(lint): ensure io/ioutil replacement (#1525)
* ci(lint): enure ioutil replacement

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>

* Update host_solaris.go
* Update process_linux_test.go
* Update net_linux_test.go
* Update net_linux_test.go
* Update process_test.go
* Update process_linux_test.go
* Update process_linux_test.go

---------

Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
Justin Yang e82d2e4ca8 host: enable uptime for NetBSD
shirou 0665cafa1b chore: replace deprecated ioutil package to os and io
shirou febdeab871 chore: change CIRCLECI environment variable to CI.
shirou 3748c19402 [host][linux]: remove double quote from lsb release info
fix: #1502
Antoine Toulme b712e59295 fix more linting reports
Antoine Toulme 38b94668ea allow to pass context values to override environment variables
Matthieu MOREL 1fb1e3e3e6 ci(lint): correct gci linter
Signed-off-by: Matthieu MOREL <matthieu.morel35@gmail.com>
Josh Powers e7c6b6991d
fix: moves common.Warnings to common OS files
This allows all OS types to unwrap the Warnings from errors, and not
just linux in host or windows in disk.

fixes: #1429
Jacob Young 02660eaf7c
Update host/host_linux.go
Use a raw string instead of escaped quotes.

Co-authored-by: shirou <shirou.faw@gmail.com>
Jacob Young 43566581f0 Recognize Cumulus Linux distro
Add Cumulus Linux and Kylin to debian family
shirou 6a5e40a517
Merge pull request #1228 from abner-chenc/master
host: add support for linux/loong64
shirou e563e6394e
Merge pull request #1356 from N1neSun/patch-1
fix some kylin linux bug
shirou 0494d7f0b9
Merge pull request #1403 from Agilicus/add-ppc64be
[host] linux/ppc: ppc64 definition from ppc64le
Guoqi Chen b793d83f72 host: add support for linux/loong64
Updates #1338.

Signed-off-by: Guoqi Chen <chenguoqi@loongson.cn>
Co-authored-by: Jiantao Shan <shanjiantao@loongson.cn>
Jeff Erbrecht a5ecb9bca5 [host] windows: use millisecond precision for BootTime()
Previously, system uptime is truncated to seconds, and then the
subtraction from `time.Now()` is performed. Because uptime does not roll
over to the next second at the same instant as `time.Now()`, then
`BootTime()` ends up not being precise, and often varies by 1 second.

This commit does the subtraction before truncating to seconds, which
results in a significantly lower chance of variance in `BootTime()`.
Don Bowman d7f1f76519
[host] linux/ppc: ppc64 definition from ppc64le
Same as commit fc04d2d, but for ppc64 from ppc64le definition.
Tobias Klauser f9a5834e0e
host: use unix.ByteSliceToString
Use ByteSliceToString provided in golang.org/x/sys/unix to convert
\0-terminated byte slices to strings.
shirou 5473fd114d [disk][host]: change to use type alias.
shirou 4ac7e99c6a [disk][host]: move back Warnings from internal to disk and host.
fix #1377
shirou 68452e2602 feat(host, windows): add UBR (Update Build Revision) to kernel version
Antoine Toulme dbc0f20fe3 code review
N1neSun add9158d4e fix some kylin linux bug
shirou ed37dc27a2
Merge pull request #1335 from tklauser/drop-darwin-386
host, process: delete darwin/386 code