{"id":13471789,"url":"https://github.com/elastic/go-sysinfo","last_synced_at":"2025-05-13T20:09:37.640Z","repository":{"id":28118364,"uuid":"116345616","full_name":"elastic/go-sysinfo","owner":"elastic","description":"go-sysinfo is a library for collecting system information.","archived":false,"fork":false,"pushed_at":"2025-04-06T22:32:00.000Z","size":662,"stargazers_count":382,"open_issues_count":18,"forks_count":90,"subscribers_count":189,"default_branch":"main","last_synced_at":"2025-04-28T10:56:43.315Z","etag":null,"topics":["go","golang","monitoring","sigar"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/elastic.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-01-05T05:25:00.000Z","updated_at":"2025-04-26T00:06:39.000Z","dependencies_parsed_at":"2023-10-12T12:20:49.468Z","dependency_job_id":"42a84d28-3a18-4bff-bf09-c8eb930bd9e0","html_url":"https://github.com/elastic/go-sysinfo","commit_stats":{"total_commits":187,"total_committers":37,"mean_commits":5.054054054054054,"dds":0.6844919786096257,"last_synced_commit":"43f710e90624a07d255e368ca5e5320a9a83e08f"},"previous_names":[],"tags_count":33,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elastic%2Fgo-sysinfo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elastic%2Fgo-sysinfo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elastic%2Fgo-sysinfo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/elastic%2Fgo-sysinfo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/elastic","download_url":"https://codeload.github.com/elastic/go-sysinfo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254020605,"owners_count":22000752,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go","golang","monitoring","sigar"],"created_at":"2024-07-31T16:00:49.277Z","updated_at":"2025-05-13T20:09:37.613Z","avatar_url":"https://github.com/elastic.png","language":"Go","funding_links":[],"categories":["开源类库","Go","Open source library"],"sub_categories":["系统信息","System Message"],"readme":"# go-sysinfo\n\n[![go](https://github.com/elastic/go-sysinfo/actions/workflows/go.yml/badge.svg)](https://github.com/elastic/go-sysinfo/actions/workflows/go.yml)\n[![Go Documentation](http://img.shields.io/badge/go-documentation-blue.svg?style=flat-square)][godocs]\n\n[godocs]: http://godoc.org/github.com/elastic/go-sysinfo\n\ngo-sysinfo is a library for collecting system information. This includes\ninformation about the host machine and processes running on the host.\n\nThe available features vary based on what has been implemented by the \"provider\"\nfor the operating system. At runtime you check to see if additional interfaces\nare implemented by the returned `Host` or `Process`. For example:\n\n```go\nprocess, err := sysinfo.Self()\nif err != nil {\n\treturn err\n}\n\nif handleCounter, ok := process.(types.OpenHandleCounter); ok {\n\tcount, err := handleCounter.OpenHandleCount()\n\tif err != nil {\n\t\treturn err\n\t}\n\tlog.Printf(\"%d open handles\", count)\n}\n```\n\nThese tables show what methods are implemented as well as the extra interfaces\nthat are implemented.\n\n| `Host` Features  | Darwin | Linux | Windows | AIX |\n|------------------|--------|-------|---------|-----|\n| `Info()`         | x      | x     | x       | x   |\n| `Memory()`       | x      | x     | x       | x   |\n| `CPUTimer`       | x      | x     | x       | x   |\n| `LoadAverage`    | x      | x     |         |     |\n| `VMStat`         |        | x     |         |     |\n| `NetworkCounters`|        | x     |         |     |\n\n| `Process` Features     | Darwin | Linux | Windows | AIX |\n|------------------------|--------|-------|---------|-----|\n| `Info()`               | x      | x     | x       | x   |\n| `Memory()`             | x      | x     | x       | x   |\n| `User()`               | x      | x     | x       | x   |\n| `Parent()`             | x      | x     | x       | x   |\n| `CPUTimer`             | x      | x     | x       | x   |\n| `Environment`          | x      | x     |         | x   |\n| `OpenHandleEnumerator` |        | x     |         |     |\n| `OpenHandleCounter`    |        | x     |         |     |\n| `Seccomp`              |        | x     |         |     |\n| `Capabilities`         |        | x     |         |     |\n| `NetworkCounters`      |        | x     |         |     |\n\n### GOOS / GOARCH Pairs\n\nThis table lists the OS and architectures for which a \"provider\" is implemented.\n\n| GOOS / GOARCH  | Requires CGO | Tested |\n|----------------|--------------|--------|\n| aix/ppc64      | x            |        |\n| darwin/amd64   | optional *   | x      |\n| darwin/arm64   | optional *   | x      |\n| linux/386      |              |        |\n| linux/amd64    |              | x      |\n| linux/arm      |              |        |\n| linux/arm64    |              |        |\n| linux/mips     |              |        |\n| linux/mips64   |              |        |\n| linux/mips64le |              |        |\n| linux/mipsle   |              |        |\n| linux/ppc64    |              |        |\n| linux/ppc64le  |              |        |\n| linux/riscv64  |              |        |\n| linux/s390x    |              |        |\n| windows/amd64  |              | x      |\n| windows/arm64  |              |        |\n| windows/arm    |              |        |\n\n* On darwin (macOS) host information like machineid and process information like memory, cpu, user and starttime require cgo.\n\n### Supported Go versions\n\ngo-sysinfo supports the [two most recent Go releases][ci_go_versions].\n\n[ci_go_versions]: https://github.com/elastic/go-sysinfo/blob/main/.github/workflows/go.yml#L40-L41\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felastic%2Fgo-sysinfo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felastic%2Fgo-sysinfo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felastic%2Fgo-sysinfo/lists"}