Coder Social home page Coder Social logo

sysinfo's Introduction

Sysinfo

Build Status Go Report Card GoDoc License Powered by Platform

Package sysinfo is a Go library providing Linux OS / kernel / hardware system information. It's completely standalone, has no dependencies on the host system, doesn't execute external programs, doesn't even import other Go libraries. It collects only "inventory type" information, things that don't change often.

Code Example

package main

import (
	"encoding/json"
	"fmt"
	"log"
	"os/user"

	"github.com/zcalusic/sysinfo"
)

func main() {
	current, err := user.Current()
	if err != nil {
		log.Fatal(err)
	}

	if current.Uid != "0" {
		log.Fatal("requires superuser privilege")
	}

	var si sysinfo.SysInfo

	si.GetSysInfo()

	data, err := json.MarshalIndent(&si, "", "  ")
	if err != nil {
		log.Fatal(err)
	}

	fmt.Println(string(data))
}

Motivation

I couldn't find any self-contained library that would provide set of data/features I needed. So another sysinfo was born.

The purpose of the library is to collect only inventory info. No metrics like CPU usage or load average will be added. The rule of thumb is, if it's changing during the day, every day, it doesn't belong in the library.

The library should work well on any modern/supported Linux distribution. There are no plans to add support for older unsupported Linux distributions/kernels, to keep the code clean and robust and reduce the maintenance burden.

Requirements

Sysinfo requires:

  • Linux kernel 4.2 or later
  • access to /sys & /proc Linux virtual file systems
  • access to various files in /etc, /var, /run FS hierarchy
  • superuser privileges (to access SMBIOS/DMI table and detect RAM size and properties)

Sysinfo doesn't require ANY other external utility on the target system, which is its primary strength, IMHO.

It depends on Linux internals heavily, so there are no plans to support other operating systems.

Installation

Just use go get.

go get github.com/zcalusic/sysinfo

There's also a very simple utility demonstrating sysinfo library capabilities. Start it (as superuser) to get pretty formatted JSON output of all the info that sysinfo library provides. Due to its simplicity, the source code of the utility also doubles down as an example of how to use the library.

go get github.com/zcalusic/sysinfo/cmd/sysinfo

--

Build demo utility in Docker container: https://github.com/mattscilipoti/compile_sysinfo

Sample output

{
  "sysinfo": {
    "version": "0.9.1",
    "timestamp": "2016-09-24T13:30:28.369498856+02:00"
  },
  "node": {
    "hostname": "web12",
    "machineid": "04aa55927ebd390829367c1757b98cac",
    "timezone": "Europe/Zagreb"
  },
  "os": {
    "name": "CentOS Linux 7 (Core)",
    "vendor": "centos",
    "version": "7",
    "release": "7.2.1511",
    "architecture": "amd64"
  },
  "kernel": {
    "release": "3.10.0-327.13.1.el7.x86_64",
    "version": "#1 SMP Thu Mar 31 16:04:38 UTC 2016",
    "architecture": "x86_64"
  },
  "product": {
    "name": "RH2288H V3",
    "vendor": "Huawei",
    "version": "V100R003",
    "serial": "2103711GEL10F3430658"
  },
  "board": {
    "name": "BC11HGSA0",
    "vendor": "Huawei",
    "version": "V100R003",
    "serial": "033HXVCNG3107624"
  },
  "chassis": {
    "type": 17,
    "vendor": "Huawei"
  },
  "bios": {
    "vendor": "Insyde Corp.",
    "version": "3.16",
    "date": "03/16/2016"
  },
  "cpu": {
    "vendor": "GenuineIntel",
    "model": "Intel(R) Xeon(R) CPU E5-2630 v3 @ 2.40GHz",
    "speed": 2400,
    "cache": 20480,
    "cpus": 1,
    "cores": 8,
    "threads": 16
  },
  "memory": {
    "type": "DRAM",
    "speed": 2133,
    "size": 65536
  },
  "storage": [
    {
      "name": "sda",
      "driver": "sd",
      "vendor": "ATA",
      "model": "ST9500620NS",
      "serial": "9XF2HZ9K",
      "size": 500
    }
  ],
  "network": [
    {
      "name": "enp3s0f1",
      "driver": "ixgbe",
      "macaddress": "84:ad:5a:e3:79:71",
      "port": "fibre",
      "speed": 10000
    }
  ]
}

Contributors

Contributors are welcome, just open a new issue / pull request.

License

The MIT License (MIT)

Copyright © 2016 Zlatko Čalušić

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

sysinfo's People

Contributors

chatenilesh avatar haraguroicha avatar itxaka avatar jm33-m0 avatar lucklove avatar mudler avatar peacerebel avatar svendowideit avatar zcalusic avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sysinfo's Issues

Cannot get mem info

  "os": {
    "name": "Fedora 28 (Twenty Eight)",
    "vendor": "fedora",
    "version": "28",
    "architecture": "amd64"
  },
  "kernel": {
    "release": "4.18.9-200.fc28.x86_64",
    "version": "#1 SMP Thu Sep 20 02:43:23 UTC 2018",
    "architecture": "x86_64"
  },
  "cpu": {
    "vendor": "AuthenticAMD",
    "model": "AMD E-450 APU with Radeon(tm) HD Graphics",
    "cache": 512,
    "cpus": 1,
    "cores": 2,
    "threads": 2
  },
  "memory": {},
  "storage": [
    {
      "name": "sda",
      "driver": "sd",
      "vendor": "ATA",
      "model": "INTEL SSDSC2BW12",
      "serial": "CVTR55210026120AGN",
      "size": 120
    }
  ],

When getting the time zone, something unexpected happened on my host, so I changed it to this

[root@localhost admin]# uname -a Linux localhost.localdomain 3.10.0-957.el7.x86_64 #1 SMP Thu Nov 8 23:39:32 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux [root@localhost admin]# cat /etc/redhat-release CentOS Linux release 7.6.1810 (Core) [root@localhost admin]# ll /etc/localtime lrwxrwxrwx. 1 root root 35 2019-10-10 13:56 /etc/localtime -> ../usr/share/zoneinfo/Asia/Shanghai
D1BF3049-2CC9-41ca-BED6-D9A4CDEFB106
image

Title

Hello. The description of this repo says %100 pure Go, but there is some assembly.

Add fedora 28 to the list of supported distros

Just did some testing on fedora 28 and it seems to work fine
note: i have hidden some sensitive things from the output
Output (user):

{
  "sysinfo": {
    "version": "0.9.2",
    "timestamp": "2018-10-28T19:59:04.379834591+01:00"
  },
  "node": {
    "hostname": "faalinator3000",
    "machineid": "---"
  },
  "os": {
    "name": "Fedora 28 (Workstation Edition)",
    "vendor": "fedora",
    "version": "28",
    "architecture": "amd64"
  },
  "kernel": {
    "release": "4.18.16-200.fc28.x86_64",
    "version": "#1 SMP Sat Oct 20 23:53:47 UTC 2018",
    "architecture": "x86_64"
  },
  "product": {
    "name": "XPS 15 9560",
    "vendor": "Dell Inc."
  },
  "board": {
    "name": "---",
    "vendor": "Dell Inc.",
    "version": "---"
  },
  "chassis": {
    "type": 10,
    "vendor": "Dell Inc."
  },
  "bios": {
    "vendor": "Dell Inc.",
    "version": "1.10.1",
    "date": "07/05/2018"
  },
  "cpu": {
    "vendor": "GenuineIntel",
    "model": "Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz",
    "cache": 6144,
    "cpus": 1,
    "cores": 4,
    "threads": 8
  },
  "memory": {},
  "storage": [
    {
      "name": "nvme0n1",
      "model": "---",
      "serial": "---",
      "size": 512
    }
  ],
  "network": [
    {
      "name": "wlp2s0",
      "driver": "---",
      "macaddress": "---"
    }
  ]
}

Output (root):

{
  "sysinfo": {
    "version": "0.9.2",
    "timestamp": "2018-10-28T19:59:45.215776379+01:00"
  },
  "node": {
    "hostname": "faalinator3000",
    "machineid": "---"
  },
  "os": {
    "name": "Fedora 28 (Workstation Edition)",
    "vendor": "fedora",
    "version": "28",
    "architecture": "amd64"
  },
  "kernel": {
    "release": "4.18.16-200.fc28.x86_64",
    "version": "#1 SMP Sat Oct 20 23:53:47 UTC 2018",
    "architecture": "x86_64"
  },
  "product": {
    "name": "XPS 15 9560",
    "vendor": "Dell Inc.",
    "serial": "---"
  },
  "board": {
    "name": "---",
    "vendor": "Dell Inc.",
    "version": "---",
    "serial": "---"
  },
  "chassis": {
    "type": 10,
    "vendor": "Dell Inc.",
    "serial": "---"
  },
  "bios": {
    "vendor": "Dell Inc.",
    "version": "1.10.1",
    "date": "07/05/2018"
  },
  "cpu": {
    "vendor": "GenuineIntel",
    "model": "Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz",
    "speed": 800,
    "cache": 6144,
    "cpus": 1,
    "cores": 4,
    "threads": 8
  },
  "memory": {
    "type": "DDR4",
    "speed": 2400,
    "size": 16384
  },
  "storage": [
    {
      "name": "nvme0n1",
      "model": "---",
      "serial": "---",
      "size": 512
    }
  ],
  "network": [
    {
      "name": "wlp2s0",
      "driver": "---",
      "macaddress": "---"
    }
  ]
}

Output of screenfetch:

$ screenfetch -n -N
 mjarkk@faalinator3000
 OS: Fedora 28 TwentyEight
 Kernel: x86_64 Linux 4.18.16-200.fc28.x86_64
 Uptime: 8h 24m
 Packages: 2395
 Shell: bash 4.4.23
 Resolution: 3840x2160
 DE: GNOME
 WM: GNOME Shell
 WM Theme: vimix-ruby
 GTK Theme: vimix-laptop-ruby [GTK2/3]
 Icon Theme: Paper
 Font: Cantarell 11
 CPU: Intel Core i7-7700HQ @ 8x 2.4GHz [25.0°C]
 GPU: GeForce GTX 1050/PCIe/SSE2
 RAM: 4622MiB / 15888MiB

Memory info should be more detail ?

Following this below of code block, there only accept/get first BANK information into memory structure (each DMI type 17 record is describe for a single BANK), but there may be use different type of memory model on server memory (e.g. different of clock speed or Bank Locator), there are not always used same memory information

Is there can add a detailed information into Memory structure or add as Memory.Details ?

e.g.:

{
  "memory": {
    "detailed": [
      {
        "bank": 0,
        "size": 8192,
        "speed": 2133,
        "type": "LPDDR3",
        "voltage": 1.2
      }, {
        "bank": 2,
        "size": 4096,
        "speed": 1866,
        "type": "LPDDR3",
        "voltage": 1.2
      }, {
        "bank": 3,
        "size": 4096,
        "speed": 1866,
        "type": "LPDDR3",
        "voltage": 1.2
      }
    ],
    "total_size": 16384
  }
}

sysinfo/memory.go

Lines 192 to 210 in 9dc8824

if si.Memory.Type == "" {
// SMBIOS Reference Specification Version 3.0.0, page 92
memTypes := [...]string{
"Other", "Unknown", "DRAM", "EDRAM", "VRAM", "SRAM", "RAM", "ROM", "FLASH",
"EEPROM", "FEPROM", "EPROM", "CDRAM", "3DRAM", "SDRAM", "SGRAM", "RDRAM",
"DDR", "DDR2", "DDR2 FB-DIMM", "Reserved", "Reserved", "Reserved", "DDR3",
"FBD2", "DDR4", "LPDDR", "LPDDR2", "LPDDR3", "LPDDR4",
}
if index := int(mem[p+0x12]); index >= 1 && index <= len(memTypes) {
si.Memory.Type = memTypes[index-1]
}
}
if si.Memory.Speed == 0 && recLen >= 0x17 {
if speed := uint(word(mem, p+0x15)); speed != 0 {
si.Memory.Speed = speed
}
}

Fix timezone detection

It seems /etc/localtime should have higher priority over /etc/timezone, if they're not in agreement.

Detect kernel modules?

Is it possible to detect hardware needed kernel modules for example to initialize NIC / HDD?

Extend information with kernel module, dependencies and if firmware ist needed?

Cannot compile on Mac OS

This issue is related to #3

Even if the necessary system calls are not available on Mac OS (and probably Windows), it would be preferable if the library could be built (if it would be portable across all platforms golang apps can be built on). It could return a nil pointer for any info that is not available.

I wanted to use this library for a project, but the fact that I cannot compile it on MacOS means I cannot.

Thank you!

RFE to allow for container usage

My use case is probably fairly unusual and I do have a work around, but I was wondering if you'd be willing to consider adding an optional value to systemInfo struct that would place a prefix on all the paths to files? What I'm attempting to do is use this package inside a docker container and mount the host filesystem into the container in order to detect the host's info. Typically when this is done you'll mount the host's FS into a directory like /host so it doesn't collide with the container's FS. So if it was possible to set something like si.PathPrefix or whatever name you like that gets prepended to each of the currently hardcoded file paths that would be very useful. For now I'm able to simply mount the host's /etc dir directly over the container's /etc and it works as expected (I personally am most interested in the OS info, so only need etc), but it would be best, and allow expanded use cases, to keep the host and container FS's separated properly.

Version semantics

Hi! Thanks for this project!
Can you create release tags? v0.9.5?
go mod tidy
github.com/zcalusic/sysinfo v0.0.0-20210905121133-6fa2f969a900
Maybe it will be better?
github.com/zcalusic/sysinfo v0.9.5

Unable to use library to pull Computer/Bios/CPU/etc. data from virtual Arm server

Hello, I am trying to use the sysinfo to pull system data while running on an Arm server.
The following stack shows that there is a failure in a Go routine due to a SIGBUS error:

Experiment URL: https://optimizer.concertio.com/projects/8a6a2052-3a06-4779-9d81-cb30cf86b392/experiments#70b2cc3b-05f5-44d1-8682-fc36f860896a unexpected fault address 0x0 fatal error: fault [signal SIGBUS: bus error code=0x3 addr=0x0 pc=0x8a1b34] goroutine 1 [running]: runtime.throw(0xb41f1d, 0x5) /usr/lib/go-1.13/src/runtime/panic.go:774 +0x54 fp=0x40001208c0 sp=0x4000120890 pc=0x45c3bc runtime.sigpanic() /usr/lib/go-1.13/src/runtime/signal_unix.go:391 +0x434 fp=0x40001208f0 sp=0x40001208c0 pc=0x471b7c github.com/zcalusic/sysinfo.cloneBytes(0xffffa040e000, 0x10000, 0x10000, 0x10000, 0x1, 0x1) /root/go/pkg/mod/github.com/zcalusic/[email protected]/memory.go:46 +0x4c fp=0x4000120930 sp=0x4000120900 pc=0x8a1b34

This error started occurring after attempting to implement the sysinfo library into the codebase.
If you are interested I may be able to provide access to the Arm server that was used (no access to the code). Hoping that the access to this server would potentially allow you time to debug so that I could use this library. Please let me know your thoughts and if you need more info in order to debug, thank you!

not enough arguments in call to syscall.Syscall

  • Win10 x64
  • Go 1.22.4

create an empty project, only one main.go, code from readme.md

package main

import (
	"encoding/json"
	"fmt"
	"log"
	"os/user"

	"github.com/zcalusic/sysinfo"
)

func main() {
	current, err := user.Current()
	if err != nil {
		log.Fatal(err)
	}

	if current.Uid != "0" {
		log.Fatal("requires superuser privilege")
	}

	var si sysinfo.SysInfo

	si.GetSysInfo()

	data, err := json.MarshalIndent(&si, "", "  ")
	if err != nil {
		log.Fatal(err)
	}

	fmt.Println(string(data))
}

run build command

go build -o sys_info.exe .\main.go

failed:

PS E:\code\GoglandProjects\sys_info> go build -o sys_info.exe .\main.go
# github.com/zcalusic/sysinfo
C:\Users\Administrator\go\pkg\mod\github.com\zcalusic\[email protected]\sysinfo.go:13:10: undefined: Kernel
C:\Users\Administrator\go\pkg\mod\github.com\zcalusic\[email protected]\sysinfo.go:48:5: si.getKernelInfo undefined (type *SysInfo has no field or method getKernelInfo)
C:\Users\Administrator\go\pkg\mod\github.com\zcalusic\[email protected]\network.go:104:41: undefined: syscall.SYS_IOCTL
C:\Users\Administrator\go\pkg\mod\github.com\zcalusic\[email protected]\network.go:104:87: not enough arguments in call to syscall.Syscall
        have (unknown type, uintptr, uintptr, uintptr)
        want (uintptr, uintptr, uintptr, uintptr, uintptr)

si.getKernelInfo undefined

go version go1.21.4 linux/amd64
set -e;\
source ./env/stage; \
while read spec; \
do\
	distro=$(echo ${spec} | cut -d/ -f1);\
	goarch=$(echo ${spec} | cut -d/ -f2);\
	arch=$(echo ${goarch} | sed 's/386/x86_32/g; s/amd64/x86_64/g; s/arm$/arm32/g');\
	echo $distro/$arch;\
	mkdir -p dist/$distro/$arch;\
	CGO_ENABLED=0 GOOS=$distro GOARCH=$goarch /usr/local/go/bin/go build -ldflags "-X github.com/aziontech/azion-cli/pkg/cmd/version.BinVersion=1.[10](https://github.com/aziontech/azion/actions/runs/7094224353/job/19309114535#step:10:11).1-dev.1 -X github.com/aziontech/azion-cli/pkg/constants.StorageApiURL=$STORAGE_URL -X github.com/aziontech/azion-cli/pkg/constants.AuthURL=$AUTH_URL -X github.com/aziontech/azion-cli/pkg/constants.ApiURL=$API_URL -X github.com/aziontech/azion-cli/pkg/cmd/edge_applications/init.TemplateBranch=$TEMPLATE_BRANCH -X github.com/aziontech/azion-cli/pkg/cmd/edge_applications/init.TemplateMajor=$TEMPLATE_MAJOR" -o ./dist/$distro/$arch/azion-1.10.1-dev.1 ./cmd/azion; \
done < BUILD
darwin/x86_64
darwin/arm64
freebsd/x86_64
# github.com/zcalusic/sysinfo
/go/pkg/mod/github.com/zcalusic/[email protected]/sysinfo.go:[13](https://github.com/aziontech/azion/actions/runs/7094224353/job/19309114535#step:10:14):10: undefined: Kernel
/go/pkg/mod/github.com/zcalusic/[email protected]/sysinfo.go:48:5: si.getKernelInfo undefined (type *SysInfo has no field or method getKernelInfo)
make: *** [Makefile:97: cross-build] Error 1

I'm getting this error on my action while building my binary for different platforms.

Error on armv7 architecture

Hello,

This program crashes if I run the program on armv7l architecture.
Here is the error stack trace:

unexpected fault address 0x0
fatal error: fault
[signal SIGBUS: bus error code=0x3 addr=0x0 pc=0x12f58]
goroutine 1 [running]:
runtime.throw(0x473c24, 0x5)
        /usr/local/go/src/runtime/panic.go:1116 +0x5c fp=0xc3ec2c sp=0xc3ec18 pc=0x46804
runtime.sigpanic()
        /usr/local/go/src/runtime/signal_unix.go:714 +0x378 fp=0xc3ec44 sp=0xc3ec2c pc=0x5df14
memeqbody()
        /usr/local/go/src/internal/bytealg/equal_arm.s:89 +0x88 fp=0xc3ec48 sp=0xc3ec48 pc=0x12f58
bytes.Equal(...)
        /usr/local/go/src/bytes/bytes.go:20
github.com/zcalusic/sysinfo.getStructureTableAddress(0xc90378, 0x0, 0x0, 0x0, 0x0, 0x0)
        /go/networkd/src/github.com/zcalusic/sysinfo/memory.go:111 +0x268 fp=0xc3ecac sp=0xc3ec48 pc=0x16ded4
github.com/zcalusic/sysinfo.getStructureTable(0x0, 0x0, 0x0, 0x0, 0x0)
        /go/networkd/src/github.com/zcalusic/sysinfo/memory.go:139 +0x2a4 fp=0xc3ed04 sp=0xc3ecac pc=0x16e29c
github.com/zcalusic/sysinfo.(*SysInfo).getMemoryInfo(0xccc000)
        /go/networkd/src/github.com/zcalusic/sysinfo/memory.go:155 +0x2c fp=0xc3ee58 sp=0xc3ed04 pc=0x16e370
github.com/zcalusic/sysinfo.(*SysInfo).GetSysInfo(0xccc000)
        /go/networkd/src/github.com/zcalusic/sysinfo/sysinfo.go:36 +0xa0 fp=0xc3ee84 sp=0xc3ee58 pc=0x171538
main.GetSysInfo(0x0, 0xc3ef20)

Thank you!

I use your library for collect info from my baremetal clusters.

I've added a video cards collector and a virtual network collector (we use bonding on our servers).

Rocky linux version not correctly handled

Hello,

The Rocky linux version number is not correctly handled,

For example, consider this:

NAME="Rocky Linux"
VERSION="9.4 (Blue Onyx)"
ID="rocky"
ID_LIKE="rhel centos fedora"
VERSION_ID="9.4"
PLATFORM_ID="platform:el9"
PRETTY_NAME="Rocky Linux 9.4 (Blue Onyx)"
ANSI_COLOR="0;32"
LOGO="fedora-logo-icon"
CPE_NAME="cpe:/o:rocky:rocky:9::baseos"
HOME_URL="https://rockylinux.org/"
BUG_REPORT_URL="https://bugs.rockylinux.org/"
SUPPORT_END="2032-05-31"
ROCKY_SUPPORT_PRODUCT="Rocky-Linux-9"
ROCKY_SUPPORT_PRODUCT_VERSION="9.4"
REDHAT_SUPPORT_PRODUCT="Rocky Linux"
REDHAT_SUPPORT_PRODUCT_VERSION="9.4"

The version is 9 but sysinfo return: 9.4.

We should have only the 9.

Best regards

GetSysInfo segfaults

I got a segfault when calling si.GetSysInfo, as shown in the stack trace.

The code responsible for this segfault is:

return ethtool.Supported

unexpected fault address 0x0                                                                                                                                            
fatal error: fault                                                                                                                                                      
[signal SIGSEGV: segmentation violation code=0x80 addr=0x0 pc=0x561cda8bc692]                                                                                           
                                                                                                                                                                        
goroutine 1 [running]:                                                                                                                                                  
runtime.throw({0x561cda8e0b5d, 0xc0002b7838})                                                                                                                           
        runtime/panic.go:1198 +0x71 fp=0xc0002b7800 sp=0xc0002b77d0 pc=0x561cda52ceb1                                                                                   
runtime.sigpanic()                                                                                                                                                      
        runtime/signal_unix.go:742 +0x2f6 fp=0xc0002b7850 sp=0xc0002b7800 pc=0x561cda542656                                                                             
github.com/zcalusic/sysinfo.getSupported({0xc00002278f, 0x4})                                                                                                           
        github.com/zcalusic/[email protected]/network.go:92 +0x172 fp=0xc0002b7908 sp=0xc0002b7850 pc=0x561cda8bc692                           
github.com/zcalusic/sysinfo.(*SysInfo).getNetworkInfo(0xc0002b7b38)                                                                                                     
        github.com/zcalusic/[email protected]/network.go:117 +0x1da fp=0xc0002b7a60 sp=0xc0002b7908 pc=0x561cda8bc97a                          
github.com/zcalusic/sysinfo.(*SysInfo).GetSysInfo(0xc0002b7b38)                                                                                                         
        github.com/zcalusic/[email protected]/sysinfo.go:44 +0xcf fp=0xc0002b7a78 sp=0xc0002b7a60 pc=0x561cda8bf02f                            
github.com/jm33-m0/emp3r0r/core/lib/agent.CollectSystemInfo()

Couldn't compile on Mac OS

I have a problem with build sysinfo on my OSX Laptop.

../sysinfo/kernel.go:24: undefined: syscall.Utsname ../sysinfo/kernel.go:25: undefined: syscall.Uname

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.