zcalusic / sysinfo

Sysinfo is a Go library providing Linux OS / kernel / hardware system information.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot get mem info

mia0x75 opened this issue · comments

  "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
    }
  ],

Hello @mia0x75 and thanks for the report.

To obtain DMI info (which also includes memory info), you need to run sysinfo as root (superuser).

As getting most but not all of the data is quite misleading, I'll probably add check and/or error output in next version.

Thanks @zcalusic , it works under root.