Coder Social home page Coder Social logo

systeminformation's Introduction

systeminformation logo

systeminformation

System and OS information library for node.js
Explore Systeminformation docs »

Report bug · Request feature · Changelog

NPM Version NPM Downloads Git Issues Closed Issues no dependencies Sponsoring Caretaker MIT license

The Systeminformation Project

This is amazing. Started as a small project just for myself, it now has > 15,000 lines of code, > 600 versions published, up to 8 mio downloads per month, > 220 mio downloads overall. #1 NPM ranking for backend packages. Thank you to all who contributed to this project!

Please support this project ... ☕️

Over the past few years I spent more than 2.000 hours working on this project and invested in hardware to be able to test on different platforms. Currently I am working very hard on the next new version 6.0 completely rewritten in TypeScript and with a lot of new features. Any support is highly appreciated - Buy me a coffee.

Your contribution make it possible for me to keep working on this project, add new features and support more platforms. Thank you in advance!

New Version 5.0

The new Version 5 is here - this next major version release 5.0 comes with new functionality and several improvements and changes (some of them are breaking changes!):

  • added audio: get detailed audio device information
  • added bluetooth: get detailed bluetooth device information
  • added dockerImages, dockerVolumes: get detailed information about docker images and volumes
  • added printer: get information from detected printers
  • added usb: get detailed usb controller and device information
  • added wifi interfaces and connections: extended wifi information
  • better uuid function to get unique hardware and OS UUIDs
  • better/extended cpu info detection
  • better/extended system info detection
  • Apple Silicon M1/M2/M3 support
  • better Raspberry-PI detection
  • systeminformation website updated and extended with full documentation and examples systeminformation.io
  • lot of minor improvements

Breaking Changes in version 5: you will see several breaking changes for the sake of a more consistent API interface and to be future proof. Read the detailed version 5 changes.

I did a lot of testing on different platforms and machines but of course there might be some issues that I am not aware of. I would be happy if you inform me when you discover any issues. Issues can be opened here.

Quick Start

Lightweight collection of 50+ functions to retrieve detailed hardware, system and OS information.

  • simple to use
  • get detailed information about system, cpu, baseboard, battery, memory, disks/filesystem, network, docker, software, services and processes
  • supports Linux, macOS, partial Windows, FreeBSD, OpenBSD, NetBSD, SunOS and Android support
  • no npm dependencies

Attention: this is a node.js library. It is supposed to be used as a backend/server-side library and will definitely not work within a browser.

Installation

npm install systeminformation --save

or simpler

npm i systeminformation

Give it a try with npx?

You just want to give it a try - right from your command line without installing it? Here is how you can call it with npx:

# get basic system info (System, OS, CPU)
npx systeminformation info

# obtain all static data - may take up to 30 seconds
npx systeminformation

Still need Version 4?

If you need version 4 (for compatibility reasons), you can install version 4 (latest release) like this

npm install systeminformation@4 —save

or simpler

npm install systeminformation@4

Usage

All functions (except version and time) are implemented as asynchronous functions. Here a small example how to use them:

const si = require('systeminformation');

// promises style - new since version 3
si.cpu()
  .then(data => console.log(data))
  .catch(error => console.error(error));

News and Changes

Latest Activity

(last 7 major and minor version releases)

  • Version 5.22.0: wifiConnections() added signal quality
  • Version 5.21.0: graphics() added subVendor (linux)
  • Version 5.20.0: mem() added writeback and dirty (linux)
  • Version 5.19.0: currentLoad() added steal and guest time (linux)
  • Version 5.18.0: fsSize() added optional drive parameter
  • Version 5.17.0: graphics() added positionX, positionY (macOS)
  • Version 5.16.0: fsSize() added rw property
  • Version 5.15.0: blockDevices() added device
  • Version 5.14.0: blockDevices() added raid group member (linux)
  • Version 5.13.0: networkConnections() added process name (macOS)
  • Version 5.12.0: cpu() added performance and efficiency cores
  • Version 5.11.0: networkInterfaces() added default property and default parameter
  • Version 5.10.0: basic android support
  • Version 5.9.0: graphics() added properties (macOS)
  • Version 5.8.0: disksIO() added waitTime, waitPercent (linux)
  • Version 5.7.0: diskLayout() added S.M.A.R.T for Windows (if installed)
  • Version 5.6.0: cpuTemperature() added socket and chipset temp (linux)
  • Version 5.5.0: dockerVolumes() added
  • Version 5.4.0: dockerImages() added
  • Version 5.3.0: osInfo() added remoteSession (win only)
  • Version 5.2.0: wifiInterfaces() and wifiConnections() added
  • Version 5.1.0: memLayout() added ECC flag, bios() added language, features (linux)
  • Version 5.0.0: new version 5 - attention there are some breaking changes. See detailed version 5 changes here.
  • ...

You can find all changes here: detailed changelog

Core concept

Node.js comes with some basic OS information, but I always wanted a little more. So I came up to write this little library. This library is still a work in progress. It is supposed to be used as a backend/server-side library (it will definitely not work within a browser). It requires node.js version 4.0 and above.

I was able to test it on several Debian, Raspbian, Ubuntu distributions as well as macOS (Mavericks, Yosemite, El Captain, Sierra, High Sierra, Mojave, Catalina, Big Sur) and some Windows 7, Windows 8, Windows 10, FreeBSD, OpenBSD, NetBSD and SunOS machines. Not all functions are supported on all operating systems. Have a look at the function reference in the docs to get further details.

If you have comments, suggestions & reports, please feel free to contact me!

I also created a nice little command line tool called mmon (micro-monitor) for Linux and macOS, also available via github and npm

Reference

Function Reference and OS Support

Full function reference with examples can be found at https://systeminformation.io.

1. General

Function Result object Linux BSD Mac Win Sun Comments
si.version() : string X X X X X lib version (no callback/promise)
si.time() {...} X X X X X (no callback/promise)
current X X X X X local (server) time
uptime X X X X X uptime in number of seconds
timezone X X X X X e.g. GMT+0200
timezoneName X X X X X e.g. CEST

2. System (HW)

Function Result object Linux BSD Mac Win Sun Comments
si.system(cb) {...} X X X X hardware information
manufacturer X X X X e.g. 'MSI'
model X X X X model/product e.g. 'MS-7823'
version X X X X version e.g. '1.0'
serial X X X X serial number
uuid X X X X UUID
sku X X X X SKU number
virtual X X X is virtual machine
virtualHost X X X virtual host (if virtual)
raspberry X optional raspberry revision data
si.bios(cb) {...} X X X X bios information
vendor X X X X e.g. 'AMI'
version X X X X version
releaseDate X X X release date
revision X X X revision
serial X X serial
si.baseboard(cb) {...} X X X X baseboard information
manufacturer X X X X e.g. 'ASUS'
model X X X X model / product name
version X X X X version
serial X X X X serial number
assetTag X X X X asset tag
memMax X X X max memory in bytes
memSlots X X X memory slots on baseboard
si.chassis(cb) {...} X X X X chassis information
manufacturer X X X X e.g. 'MSI'
model X X X X model / product name
type X X X X model / product name
version X X X X version
serial X X X X serial number
assetTag X X X X asset tag
sku X SKU number

3. CPU

Function Result object Linux BSD Mac Win Sun Comments
si.cpu(cb) {...} X X X X CPU information
manufacturer X X X X e.g. 'Intel(R)'
brand X X X X e.g. 'Core(TM)2 Duo'
speed X X X X in GHz e.g. '3.40'
speedMin X X X in GHz e.g. '0.80'
speedMax X X X X in GHz e.g. '3.90'
governor X e.g. 'powersave'
cores X X X X # cores
physicalCores X X X X # physical cores
efficiencyCores X X # efficiency cores
performanceCores X X # performance cores
processors X X X X # processors
socket X X X socket type e.g. "LGA1356"
vendor X X X X vendor ID
family X X X X processor family
model X X X X processor model
stepping X X X X processor stepping
revision X X X revision
voltage X voltage
flags X X X X CPU flags
virtualization X X X X virtualization supported
cache X X X X cache in bytes (object)
cache.l1d X X X X L1D (data) size
cache.l1i X X X X L1I (instruction) size
cache.l2 X X X X L2 size
cache.l3 X X X X L3 size
si.cpuFlags(cb) : string X X X X CPU flags
si.cpuCache(cb) {...} X X X X CPU cache sizes
l1d X X X X L1D size
l1i X X X X L1I size
l2 X X X X L2 size
l3 X X X X L3 size
si.cpuCurrentSpeed(cb) {...} X X X X X current CPU speed (in GHz)
avg X X X X X avg CPU speed (all cores)
min X X X X X min CPU speed (all cores)
max X X X X X max CPU speed (all cores)
cores X X X X X CPU speed per core (array)
si.cpuTemperature(cb) {...} X X X* X CPU temperature in C (if supported)
main X X X X main temperature (avg)
cores X X X X array of temperatures
max X X X X max temperature
socket X array socket temperatures
chipset X chipset temperature

4. Memory

Function Result object Linux BSD Mac Win Sun Comments
si.mem(cb) {...} X X X X X Memory information (in bytes)
total X X X X X total memory in bytes
free X X X X X not used in bytes
used X X X X X used (incl. buffers/cache)
active X X X X X used actively (excl. buffers/cache)
buffcache X X X X used by buffers+cache
buffers X used by buffers
cached X used by cache
slab X used by slab
available X X X X X potentially available (total - active)
swaptotal X X X X X
swapused X X X X X
swapfree X X X X X
writeback X
dirty X
si.memLayout(cb) [{...}] X X X X Memory Layout (array)
[0].size X X X X size in bytes
[0].bank X X X memory bank
[0].type X X X X memory type
[0].clockSpeed X X X X clock speed
[0].formFactor X X X form factor
[0].manufacturer X X X X manufacturer
[0].partNum X X X X part number
[0].serialNum X X X X serial number
[0].voltageConfigured X X X voltage conf.
[0].voltageMin X X X voltage min
[0].voltageMax X X X voltage max

5. Battery

Function Result object Linux BSD Mac Win Sun Comments
si.battery(cb) {...} X X X X battery information
hasBattery X X X X indicates presence of battery
cycleCount X X numbers of recharges
isCharging X X X X indicates if battery is charging
designedCapacity X X X max capacity of battery (mWh)
maxCapacity X X X max capacity of battery (mWh)
currentCapacity X X X current capacity of battery (mWh)
capacityUnit X X X capacity unit (mWh)
voltage X X X current voltage of battery (V)
percent X X X X charging level in percent
timeRemaining X X minutes left (if discharging)
acConnected X X X X AC connected
type X X battery type
model X X model
manufacturer X X manufacturer
serial X X battery serial
  • See known issues if you have a problem with macOS temperature or windows temperature

6. Graphics

Function Result object Linux BSD Mac Win Sun Comments
si.graphics(cb) {...} X X X arrays of graphics controllers and displays
controllers[] X X X graphics controllers array
...[0].vendor X X X e.g. NVIDIA
...[0].subVendor X e.g. Gigabyte
...[0].vendorId X vendor ID
...[0].model X X X graphics controller model
...[0].deviceId X device ID
...[0].bus X X X on which bus (e.g. PCIe)
...[0].vram X X X VRAM size (in MB)
...[0].vramDynamic X X X true if dynamically allocated ram
...[0].external X is external GPU
...[0].cores X Apple silicon only
...[0].metalVersion X Apple Metal Version
displays[] X X X monitor/display array
...[0].vendor X monitor/display vendor
...[0].vendorId X vendor ID
...[0].deviceName X e.g. \\.\DISPLAY1
...[0].model X X X monitor/display model
...[0].productionYear X production year
...[0].serial X serial number
...[0].displayId X display ID
...[0].main X X X true if main monitor
...[0].builtin X X true if built-in monitor
...[0].connection X X X e.g. DisplayPort or HDMI
...[0].sizeX X X size in mm horizontal
...[0].sizeY X X size in mm vertical
...[0].pixelDepth X X X color depth in bits
...[0].resolutionX X X X pixel horizontal
...[0].resolutionY X X X pixel vertical
...[0].currentResX X X X current pixel horizontal
...[0].currentResY X X X current pixel vertical
...[0].positionX X X display position X
...[0].positionY X X display position Y
...[0].currentRefreshRate X X X current screen refresh rate

7. Operating System

Function Result object Linux BSD Mac Win Sun Comments
si.osInfo(cb) {...} X X X X X OS information
platform X X X X X 'linux', 'darwin', 'Windows', ...
distro X X X X X
release X X X X X
codename X X
kernel X X X X X kernel release - same as os.release()
arch X X X X X same as os.arch()
hostname X X X X X same as os.hostname()
fqdn X X X X X FQDN fully qualified domain name
codepage X X X X OS build version
logofile X X X X X e.g. 'apple', 'debian', 'fedora', ...
serial X X X X OS/Host serial number
build X X X OS build version
servicepack X service pack version
uefi X X X X OS started via UEFI
hypervisor X hyper-v enabled? (win only)
remoteSession X runs in remote session (win only)
si.uuid(cb) {...} X X X X X object of several UUIDs
os X X X X os specific UUID
hardware X X X X hardware specific UUID
macs X X X X MAC addresses
si.versions(apps, cb) {...} X X X X X version information (kernel, ssl, node, ...)
apps param is optional for detecting
only specific apps/libs
(string, comma separated)
si.shell(cb) : string X X X X standard shell
si.users(cb) [{...}] X X X X X array of users online
[0].user X X X X X user name
[0].tty X X X X X terminal
[0].date X X X X X login date
[0].time X X X X X login time
[0].ip X X X X ip address (remote login)
[0].command X X X X last command or shell

8. Current Load, Processes & Services

Function Result object Linux BSD Mac Win Sun Comments
si.currentLoad(cb) {...} X X X X CPU-Load
avgLoad X X X average load
currentLoad X X X X CPU load in %
currentLoadUser X X X X CPU load user in %
currentLoadSystem X X X X CPU load system in %
currentLoadNice X X X X CPU load nice in %
currentLoadIdle X X X X CPU load idle in %
currentLoadIrq X X X X CPU load system in %
rawCurrentLoad... X X X X CPU load raw values (ticks)
cpus[] X X X X current loads per CPU in % + raw ticks
si.fullLoad(cb) : integer X X X CPU full load since bootup in %
si.processes(cb) {...} X X X X X # running processes
all X X X X X # of all processes
running X X X X # of all processes running
blocked X X X X # of all processes blocked
sleeping X X X X # of all processes sleeping
unknown X # of all processes unknown status
list[] X X X X X list of all processes incl. details
...[0].pid X X X X X process PID
...[0].parentPid X X X X X parent process PID
...[0].name X X X X X process name
...[0].cpu X X X X X process % CPU usage
...[0].cpuu X X X process % CPU usage (user)
...[0].cpus X X X process % CPU usage (system)
...[0].mem X X X X X process memory %
...[0].priority X X X X X process priority
...[0].memVsz X X X X X process virtual memory size
...[0].memRss X X X X X process mem resident set size
...[0].nice X X X X process nice value
...[0].started X X X X X process start time
...[0].state X X X X X process state (e.g. sleeping)
...[0].tty X X X X tty from which process was started
...[0].user X X X X user who started process
...[0].command X X X X X process starting command
...[0].params X X X X process params
...[0].path X X X X X process path
proc X X X X process name
pid X X X X PID
pids X X X X additional pids
cpu X X X X process % CPU
mem X X X X process % MEM
si.services('mysql, apache2', cb) [{...}] X X X X pass comma separated string of services
pass "*" for ALL services (linux/win only)
[0].name X X X X name of service
[0].running X X X X true / false
[0].startmode X manual, automatic, ...
[0].pids X X X X pids
[0].cpu X X X process % CPU
[0].mem X X X process % MEM
si.processLoad('mysql, apache2', cb) [{...}] X X X X pass comma separated string of processes
pass "*" for ALL processes (linux/win only)
[0].proc X X X X name of process
[0].pids X X X X pids
[0].cpu X X X process % CPU
[0].mem X X X process % MEM

9. File System

Function Result object Linux BSD Mac Win Sun Comments
si.diskLayout(cb) [{...}] X X X physical disk layout (array)
[0].device X X e.g. /dev/sda
[0].type X X X HD, SSD, NVMe
[0].name X X X disk name
[0].vendor X X vendor/producer
[0].size X X X size in bytes
[0].bytesPerSector X bytes per sector
[0].totalCylinders X total cylinders
[0].totalHeads X total heads
[0].totalSectors X total sectors
[0].totalTracks X total tracks
[0].tracksPerCylinder X tracks per cylinder
[0].sectorsPerTrack X sectors per track
[0].firmwareRevision X X X firmware revision
[0].serialNum X X X serial number
[0].interfaceType X X SATA, PCIe, ...
[0].smartStatus X X X S.M.A.R.T Status (see Known Issues)
[0].temperature X S.M.A.R.T temperature
[0].smartData X X full S.M.A.R.T data from smartctl
requires at least smartmontools 7.0
si.blockDevices(cb) [{...}] X X X returns array of disks, partitions,
raids and roms
[0].name X X X name
[0].type X X X type
[0].fstype X X X file system type (e.g. ext4)
[0].mount X X X mount point
[0].size X X X size in bytes
[0].physical X X X physical type (HDD, SSD, CD/DVD)
[0].uuid X X X UUID
[0].label X X X label
[0].model X X model
[0].serial X X serial
[0].removable X X X serial
[0].protocol X X protocol (SATA, PCI-Express, ...)
[0].group X Raid group member (e.g. md1)
[0].device X X X physical device mapped to (e.g. /dev/sda)
si.disksIO(cb) {...} X X current transfer stats
rIO X X read IOs on all mounted drives
wIO X X write IOs on all mounted drives
tIO X X write IOs on all mounted drives
rIO_sec X X read IO per sec (* see notes)
wIO_sec X X write IO per sec (* see notes)
tIO_sec X X total IO per sec (* see notes)
rWaitTime X read IO request time (* see notes)
wWaitTime X write IO request time (* see notes)
tWaitTime X total IO request time (* see notes)
rWaitPercent X read IO request time percent (* see notes)
wWaitPercent X write IO request time percent (* see notes)
tWaitPercent X total IO request time percent (* see notes)
ms X X interval length (for per second values)
si.fsSize(drive, cb) [{...}] X X X X returns array of mounted file systems
drive param is optional
[0].fs X X X X name of file system
[0].type X X X X type of file system
[0].size X X X X sizes in bytes
[0].used X X X X used in bytes
[0].available X X X X used in bytes
[0].use X X X X used in %
[0].mount X X X X mount point
[0].rw X X X X read and write (false if read only)
si.fsOpenFiles(cb) {...} X X X count max/allocated file descriptors
max X X X max file descriptors
allocated X X X current open files count
available X X X count available
si.fsStats(cb) {...} X X current transfer stats
rx X X bytes read since startup
wx X X bytes written since startup
tx X X total bytes read + written since startup
rx_sec X X bytes read / second (* see notes)
wx_sec X X bytes written / second (* see notes)
tx_sec X X total bytes reads + written / second
ms X X interval length (for per second values)

10. USB

Function Result object Linux BSD Mac Win Sun Comments
si.usb(cb) [{...}] X X X X get detected USB devices
[0].bus X USB bus
[0].deviceId X bus device id
[0].id X X X internal id
[0].name X X X name
[0].type X X X name
[0].removable X is removable
[0].vendor X X vendor
[0].manufacturer X X X manufacturer
[0].maxPower X max power
[0].default X X X is default printer
[0].serialNumber X serial number

11. Printer

Function Result object Linux BSD Mac Win Sun Comments
si.printer(cb) [{...}] X X X X get printer information
[0].id X X X internal id
[0].name X X X name
[0].model X X X model
[0].uri X X printer URI
[0].uuid X printer UUID
[0].status X X X printer status (e.g. idle)
[0].local X X X is local printer
[0].default X X is default printer
[0].shared X X X is shared printer

12. Audio

Function Result object Linux BSD Mac Win Sun Comments
si.audio(cb) [{...}] X X X X get printer information
[0].id X X X internal id
[0].name X X X name
[0].manufacturer X X X manufacturer
[0].revision X revision
[0].driver X driver
[0].default X X is default
[0].channel X X channel e.g. USB, HDMI, ...
[0].type X X X type e.g. Speaker
[0].in X X is input channel
[0].out X X is output channel
[0].interfaceType X X X interface type (PCIe, USB, HDMI, ...)
[0].status X X X printer status (e.g. idle)

13. Network related functions

Function Result object Linux BSD Mac Win Sun Comments
si.networkInterfaces(cb) [{...}] X X X X X array of network interfaces
With the 'default' parameter it returns
only the default interface
[0].iface X X X X X interface
[0].ifaceName X X X X X interface name (differs on Windows)
[0].default X X X X X true if this is the default interface
[0].ip4 X X X X X ip4 address
[0].ip4subnet X X X X X ip4 subnet mask
[0].ip6 X X X X X ip6 address
[0].ip6subnet X X X X X ip6 subnet mask
[0].mac X X X X X MAC address
[0].internal X X X X X true if internal interface
[0].virtual X X X X X true if virtual interface
[0].operstate X X X up / down
[0].type X X X wireless / wired
[0].duplex X X duplex
[0].mtu X X maximum transmission unit
[0].speed X X X speed in MBit / s
[0].dhcp X X X IP address obtained by DHCP
[0].dnsSuffix X X DNS suffix
[0].ieee8021xAuth X X IEEE 802.1x auth
[0].ieee8021xState X X IEEE 802.1x state
[0].carrierChanges X # changes up/down
si.networkInterfaceDefault(cb) : string X X X X X get name of default network interface
si.networkGatewayDefault(cb) : string X X X X X get default network gateway
si.networkStats(ifaces,cb) [{...}] X X X X current network stats of given interfaces
iface list: space or comma separated
iface parameter is optional
defaults to first external network interface,
Pass '*' for all interfaces
[0].iface X X X X interface
[0].operstate X X X X up / down
[0].rx_bytes X X X X received bytes overall
[0].rx_dropped X X X X received dropped overall
[0].rx_errors X X X X received errors overall
[0].tx_bytes X X X X transferred bytes overall
[0].tx_dropped X X X X transferred dropped overall
[0].tx_errors X X X X transferred errors overall
[0].rx_sec X X X X received bytes / second (* see notes)
[0].tx_sec X X X X transferred bytes per second (* see notes)
[0].ms X X X X interval length (for per second values)
si.networkConnections(cb) [{...}] X X X X current network network connections
returns an array of all connections
[0].protocol X X X X tcp or udp
[0].localAddress X X X X local address
[0].localPort X X X X local port
[0].peerAddress X X X X peer address
[0].peerPort X X X X peer port
[0].state X X X X like ESTABLISHED, TIME_WAIT, ...
[0].pid X X X X process ID
[0].process X X X process name
si.inetChecksite(url, cb) {...} X X X X X response-time (ms) to fetch given URL
url X X X X X given url
ok X X X X X status code OK (2xx, 3xx)
status X X X X X status code
ms X X X X X response time in ms
si.inetLatency(host, cb) : number X X X X X response-time (ms) to external resource
host parameter is optional (default 8.8.8.8)

14. Wifi

Function Result object Linux BSD Mac Win Sun Comments
si.wifiNetworks(cb) [{...}] X X X array of available wifi networks
[0].ssid X X X Wifi network SSID
[0].bssid X X X BSSID (mac)
[0].mode X mode
[0].channel X X X channel
[0].frequency X X X frequency in MHz
[0].signalLevel X X X signal level in dB
[0].quality X X X quality in %
[0].security X X X array e.g. WPA, WPA-2
[0].wpaFlags X X X array of WPA flags
[0].rsnFlags X array of RDN flags
si.wifiInterfaces(cb) [{...}] X X X array of detected wifi interfaces
[0].id X X X ID
[0].iface X X X interface
[0].model X X X model
[0].vendor X X X vendor
[0].mac X X X MAC address
si.wifiConnections(cb) [{...}] X X X array of active wifi connections
[0].id X X X ID
[0].iface X X X interface
[0].model X X X model
[0].ssid X X X SSID
[0].bssid X (X) X BSSID (mac) - macOS only on older os versions
[0].channel X X X channel
[0].frequency X X X frequency in MHz
[0].type X X X e.g. 802.11
[0].security X X X array e.g. WPA, WPA-2
[0].signalLevel X X X signal level in dB
[0].quality X X X quality in %
[0].txRate X X X transfer rate MBit/s

15. Bluetooth

Function Result object Linux BSD Mac Win Sun Comments
si.bluetoothDevices(cb) [{...}] X X X ...
[0].device X device name
[0].name X X X name
[0].macDevice X X MAC address device
[0].macHost X X MAC address host
[0].batteryPercent X battery level percent
[0].manufacturer X X manufacturer
[0].type X X X type of bluetooth device
[0].connected X X is connected

16. Docker

Function Result object Linux BSD Mac Win Sun Comments
si.dockerInfo(cb) {...} X X X X X returns general docker info
id X X X X X Docker ID
containers X X X X X number of containers
containersRunning X X X X X number of running containers
containersPaused X X X X X number of paused containers
containersStopped X X X X X number of stopped containers
images X X X X X number of images
driver X X X X X driver (e.g. 'devicemapper', 'overlay2')
memoryLimit X X X X X has memory limit
swapLimit X X X X X has swap limit
kernelMemory X X X X X has kernel memory
cpuCfsPeriod X X X X X has CpuCfsPeriod
cpuCfsQuota X X X X X has CpuCfsQuota
cpuShares X X X X X has CPUShares
cpuSet X X X X X has CPUShares
ipv4Forwarding X X X X X has IPv4Forwarding
bridgeNfIptables X X X X X has BridgeNfIptables
bridgeNfIp6tables X X X X X has BridgeNfIp6tables
debug X X X X X Debug on
nfd X X X X X named data networking forwarding daemon
oomKillDisable X X X X X out-of-memory kill disabled
ngoroutines X X X X X number NGoroutines
systemTime X X X X X docker SystemTime
loggingDriver X X X X X logging driver e.g. 'json-file'
cgroupDriver X X X X X cgroup driver e.g. 'cgroupfs'
nEventsListener X X X X X number NEventsListeners
kernelVersion X X X X X docker kernel version
operatingSystem X X X X X docker OS e.g. 'Docker for Mac'
osType X X X X X OSType e.g. 'linux'
architecture X X X X X architecture e.g. x86_64
ncpu X X X X X number of CPUs
memTotal X X X X X memory total
dockerRootDir X X X X X docker root directory
httpProxy X X X X X http proxy
httpsProxy X X X X X https proxy
noProxy X X X X X NoProxy
name X X X X X Name
labels X X X X X array of labels
experimentalBuild X X X X X is experimental build
serverVersion X X X X X server version
clusterStore X X X X X cluster store
clusterAdvertise X X X X X cluster advertise
defaultRuntime X X X X X default runtime e.g. 'runc'
liveRestoreEnabled X X X X X live store enabled
isolation X X X X X isolation
initBinary X X X X X init binary
productLicense X X X X X product license
si.dockerImages(all, cb) [{...}] X X X X X returns array of top level/all docker images
[0].id X X X X X image ID
[0].container X X X X X container ID
[0].comment X X X X X comment
[0].os X X X X X OS
[0].architecture X X X X X architecture
[0].parent X X X X X parent ID
[0].dockerVersion X X X X X docker version
[0].size X X X X X image size
[0].sharedSize X X X X X shared size
[0].virtualSize X X X X X virtual size
[0].author X X X X X author
[0].created X X X X X created date / time
[0].containerConfig X X X X X container config object
[0].graphDriver X X X X X graph driver object
[0].repoDigests X X X X X repo digests array
[0].repoTags X X X X X repo tags array
[0].config X X X X X config object
[0].rootFS X X X X X root fs object
si.dockerContainers(all, cb) [{...}] X X X X X returns array of active/all docker containers
[0].id X X X X X ID of container
[0].name X X X X X name of container
[0].image X X X X X name of image
[0].imageID X X X X X ID of image
[0].command X X X X X command
[0].created X X X X X creation time (unix)
[0].started X X X X X creation time (unix)
[0].finished X X X X X creation time (unix)
[0].createdAt X X X X X creation date time string
[0].startedAt X X X X X creation date time string
[0].finishedAt X X X X X creation date time string
[0].state X X X X X created, running, exited
[0].ports X X X X X array of ports
[0].mounts X X X X X array of mounts
si.dockerContainerStats(ids, cb) [{...}] X X X X X statistics for specific containers
container IDs: space or comma separated,
pass '*' for all containers
[0].id X X X X X Container ID
[0].memUsage X X X X X memory usage in bytes
[0].memLimit X X X X X memory limit (max mem) in bytes
[0].memPercent X X X X X memory usage in percent
[0].cpuPercent X X X X X cpu usage in percent
[0].pids X X X X X number of processes
[0].netIO.rx X X X X X received bytes via network
[0].netIO.wx X X X X X sent bytes via network
[0].blockIO.r X X X X X bytes read from BlockIO
[0].blockIO.w X X X X X bytes written to BlockIO
[0].cpuStats X X X X X detailed cpu stats
[0].percpuStats X X X X X detailed per cpu stats
[0].memoryStats X X X X X detailed memory stats
[0].networks X X X X X detailed network stats per interface
si.dockerContainerProcesses(id, cb) [{...}] X X X X X array of processes inside a container
[0].pidHost X X X X X process ID (host)
[0].ppid X X X X X parent process ID
[0].pgid X X X X X process group ID
[0].user X X X X X effective user name
[0].ruser X X X X X real user name
[0].group X X X X X effective group name
[0].rgroup X X X X X real group name
[0].stat X X X X X process state
[0].time X X X X X accumulated CPU time
[0].elapsed X X X X X elapsed running time
[0].nice X X X X X nice value
[0].rss X X X X X resident set size
[0].vsz X X X X X virtual size in Kbytes
[0].command X X X X X command and arguments
si.dockerVolumes(cb) [{...}] returns array of all docker volumes
[0].name X X X X X volume name
[0].driver X X X X X driver
[0].labels X X X X X labels object
[0].mountpoint X X X X X mountpoint
[0].options X X X X X options
[0].scope X X X X X scope
[0].created X X X X X created at
si.dockerAll(cb) {...} X X X X X list of all containers including their stats
and processes in one single array

17. Virtual Box

Function Result object Linux BSD Mac Win Sun Comments
si.vboxInfo(cb) [{...}] X X X X X returns array general virtual box info
[0].id X X X X X virtual box ID
[0].name X X X X X name
[0].running X X X X X vbox is running
[0].started X X X X X started date time
[0].runningSince X X X X X running since (secs)
[0].stopped X X X X X stopped date time
[0].stoppedSince X X X X X stopped since (secs)
[0].guestOS X X X X X Guest OS
[0].hardwareUUID X X X X X Hardware UUID
[0].memory X X X X X Memory in MB
[0].vram X X X X X VRAM in MB
[0].cpus X X X X X CPUs
[0].cpuExepCap X X X X X CPU exec cap
[0].cpuProfile X X X X X CPU profile
[0].chipset X X X X X chipset
[0].firmware X X X X X firmware
[0].pageFusion X X X X X page fusion
[0].configFile X X X X X config file
[0].snapshotFolder X X X X X snapshot folder
[0].logFolder X X X X X log folder path
[0].hpet X X X X X HPET
[0].pae X X X X X PAE
[0].longMode X X X X X long mode
[0].tripleFaultReset X X X X X triple fault reset
[0].apic X X X X X APIC
[0].x2Apic X X X X X X2APIC
[0].acpi X X X X X ACPI
[0].ioApic X X X X X IOAPIC
[0].biosApicMode X X X X X BIOS APIC mode
[0].bootMenuMode X X X X X boot menu Mode
[0].bootDevice1 X X X X X bootDevice1
[0].bootDevice2 X X X X X bootDevice2
[0].bootDevice3 X X X X X bootDevice3
[0].bootDevice4 X X X X X bootDevice4
[0].timeOffset X X X X X time Offset
[0].rtc X X X X X RTC

16. "Get All / Observe" - functions

Function Result object Linux BSD Mac Win Sun Comments
si.getStaticData(cb) {...} X X X X X all static data at once
si.getDynamicData(srv,iface,cb) {...} X X X X X all dynamic data at once
Specify services and interfaces to monitor
Defaults to first external network interface
Pass "" for ALL services (linux/win only)
Pass "
" for ALL network interfaces
si.getAllData(srv,iface,cb) {...} X X X X X all data at once
Specify services and interfaces to monitor
Defaults to first external network interface
Pass "" for ALL services (linux/win only)
Pass "
" for ALL network interfaces
si.get(valueObject,cb) {...} X X X X X get partial system info data at once
In valueObject you can define
all values, you want to get back
(see documentation for details)
si.observe(valueObject,interval,cb) - X X X X X Observe a defined value object
call callback on changes
polling interval in milliseconds

cb: Asynchronous Function Calls (callback)

Remember: all functions (except version and time) are implemented as asynchronous functions! There are now three ways to consume them:

Callback Style

const si = require('systeminformation');

si.cpu(function(data) {
  console.log('CPU Information:');
  console.log('- manufacturer: ' + data.manufacturer);
  console.log('- brand: ' + data.brand);
  console.log('- speed: ' + data.speed);
  console.log('- cores: ' + data.cores);
  console.log('- physical cores: ' + data.physicalCores);
  console.log('...');
})

Promises

Promises Style is new in version 3.0.

When omitting callback parameter (cb), then you can use all function in a promise oriented way. All functions (except of version and time) are returning a promise, that you can consume:

const si = require('systeminformation');

si.cpu()
  .then(data => {
    console.log('CPU Information:');
    console.log('- manufacturer: ' + data.manufacturer);
    console.log('- brand: ' + data.brand);
    console.log('- speed: ' + data.speed);
    console.log('- cores: ' + data.cores);
    console.log('- physical cores: ' + data.physicalCores);
    console.log('...');
  })
  .catch(error => console.error(error));

Async / Await

Using async / await (available since node v7.6)

Since node v7.6 you can also use the async / await pattern. The above example would then look like this:

const si = require('systeminformation');

async function cpuData() {
  try {
    const data = await si.cpu();
    console.log('CPU Information:');
    console.log('- manufacturer: ' + data.manufacturer);
    console.log('- brand: ' + data.brand);
    console.log('- speed: ' + data.speed);
    console.log('- cores: ' + data.cores);
    console.log('- physical cores: ' + data.physicalCores);
    console.log('...');
  } catch (e) {
    console.log(e)
  }
}

Known Issues

macOS - Temperature Sensor

To be able to measure temperature on macOS I created a little additional package. Due to some difficulties in NPM with optionalDependencies I unfortunately was getting unexpected warnings on other platforms. So I decided to drop this optional dependency for macOS - so by default, you will not get correct values.

This additional package is now also supporting Apple Silicon M1/M2/M3 machines.

But if you need to detect macOS temperature just run the following additional installation command:

$ npm install osx-temperature-sensor --save

systeminformation will then detect this additional library and return the temperature when calling systeminformations standard function cpuTemperature()

Windows Temperature, Battery, ...

get-WmiObject - which is used to determine temperature and battery sometimes needs to be run with admin privileges. So if you do not get any values, try to run it again with according privileges. If you still do not get any values, your system might not support this feature. In some cases we also discovered that get-WmiObject returned incorrect temperature values.

Linux Temperature

In some cases you need to install the Linux sensors package to be able to measure temperature e.g. on DEBIAN based systems by running sudo apt-get install lm-sensors

Linux S.M.A.R.T. Status

To be able to detect S.M.A.R.T. status on Linux you need to install smartmontools. On DEBIAN based Linux distributions you can install it by running sudo apt-get install smartmontools

Windows Encoding Issues

I now reimplemented all windows functions to avoid encoding problems (special chacarters). And as Windows 11 now dropped wmic support, I had to move completely to powershell. Be sure that powershell version 5+ is installed on your machine. On older Windows versions (7, 8) you might still see encoding problems due to the old powershell version.

*: Additional Notes

In fsStats(), disksIO() and networkStats() the results / sec. values (rx_sec, IOPS, ...) are calculated correctly beginning with the second call of the function. It is determined by calculating the difference of transferred bytes / IOs divided by the time between two calls of the function.

The first time you are calling one of these functions, you will get null for transfer rates. The second time, you should then get statistics based on the time between the two calls ...

So basically, if you e.g. need a value for network stats every second, your code should look like this:

const si = require('systeminformation');

setInterval(function() {
  si.networkStats().then(data => {
    console.log(data);
  })
}, 1000)

Beginning with the second call, you get network transfer values per second.

Finding new issues

I am happy to discuss any comments and suggestions. Please feel free to contact me if you see any possibility of improvement!

Comments

If you have ideas or comments, please do not hesitate to contact me.

Happy monitoring!

Sincerely,

Sebastian Hildebrandt, +innovations

Credits

Written by Sebastian Hildebrandt sebhildebrandt

Contributors

OSX Temperature: credits here are going to:

Copyright Information

Linux is a registered trademark of Linus Torvalds. Apple, macOS, OS X are registered trademarks of Apple Inc., Windows is a registered trademark of Microsoft Corporation. Node.js is a trademark of Joyent Inc., Intel is a trademark of Intel Corporation, AMD is a trademark of Advanced Micro Devices Inc., Raspberry Pi is a trademark of the Raspberry Pi Foundation, Debian is a trademark owned by Software in the Public Interest, Inc., Ubuntu is a trademark of Canonical Ltd., FreeBSD is a registered trademark of The FreeBSD Foundation, NetBSD is a registered trademark of The NetBSD Foundation, Docker is a trademark of Docker, Inc., Sun, Solaris, OpenSolaris and registered trademarks of Sun Microsystems, VMware is a trademark of VMware Inc, Virtual Box is a trademark of Oracle Corporation, Xen is a registered trademark of Xen Project, QEMU is a trademark of Fabrice Bellard, bochs is a trademark of The Bochs Project, USB and USB Logo are trademarks of USB Implementation Forum, Bluetooth and Bluetooth Logo are trademarks of Bluetooth SIG, Android is a trademark of Google LLC, Parallels is a trademarks of Parallels International GmbH.

All other trademarks are the property of their respective owners.

License MIT license

The MIT License (MIT)

Copyright © 2014-2024 Sebastian Hildebrandt, +innovations.

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.

Further details see LICENSE file.

systeminformation's People

Contributors

effectrenan avatar jorgegonzalez avatar juancamp avatar juancampuzano avatar juanescarraga avatar mariacamilacubides avatar mily20001 avatar omgimalexis avatar plakak avatar sebhildebrandt avatar seniorquico avatar si458 avatar zprjk 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

systeminformation's Issues

Don't Returns Mac's

node 8.4
Ubuntu 17.10

  { iface: 'wlx803f5d20b751',
    ip4: '192.168.0.17',
    ip6: '',
    mac: '00:00:00:00:00:00',
    internal: false },
  { iface: 'docker0',
    ip4: '172.17.0.1',
    ip6: '',
    mac: '00:00:00:00:00:00',
    internal: false },
  { iface: 'br-79bf4b77c82a',
    ip4: '172.19.0.1',
    ip6: '',
    mac: '00:00:00:00:00:00',
    internal: false } ]

Latest version is too cool

Your package.json says you support node >= 4 but you're using ES6 features not supported by node 4.x

/opt/agent/server/node_modules/systeminformation/lib/internet.js:59
              const { statusCode } = res;

si.users() is broken

si.users() seems to be broken with node v4.0.0. See error below:

systeminformation/lib/index.js:683
    result.users = [];
    ^

ReferenceError: result is not defined

use of new si.blockDevices(cb)

Hello again, Sebastian,

I can't get this to work. I tested in the Node.js REPL (see below).

This is a CentOS 6 VM.

Am I doing something wrong?

In the meantime, I will try it on an Ubuntu 16 VM.

Thanks.

-Paul

[root@localhost ecxmon]# nano package.json
[root@localhost ecxmon]# npm install --save
[email protected] /home/ecxcc/ecxmon
└── [email protected]

[root@localhost ecxmon]# node
> var si = require('systeminformation')
undefined
> si.blockDevices(function(d) { console.log(d) } )
Promise { <pending> }
> []

> si.blockDevices(function(d) { console.log(d) } )
Promise { <pending> }
> []

> si.version()
'3.11.0'
>

cpuTemperature not returning anything on OSX or Windows

Hi Sebastian,

First off thanks for putting this package together, I have enjoyed working with it the last couple of days.

Unfortunately, I have noticed that cpuTemperature is not returning anything. I have tested on OSX and Windows 10 and have confirmed with other system apps that both devices have a temp monitor running and reporting.

Cheers,

Not all ifaces detected, users problem

So i just tried new version of systeminformation.

It doesn't crash without root - that's great. But few things don't look entirely correct:

networkStats:

sys.networkInterfaces(function(s){console.log(s)})
Promise { <pending> }
> [ { iface: 'lo', ip4: '127.0.0.1', ip6: '::1', internal: true },
{ iface: 'br0',
ip4: '192.168.1.3',
ip6: 'fe80::f66d:4ff:fe97:cc1c',
internal: false },
{ iface: 'vmnet1',
ip4: '172.16.56.1',
ip6: 'fe80::250:56ff:fec0:1',
internal: false },
{ iface: 'vmnet8',
ip4: '192.168.99.1',
ip6: 'fe80::250:56ff:fec0:8',
internal: false } ]

whereas:

lapsio@linux-qzuq ~> ip link list
1: lo: ...
2: eno1: ... <- missing
3: br0: ...
4: vmnet1:...
5: vmnet8: ...

I just checked and os.networkInterfaces is also missing eno1

And .users() returns empty array now on my machine.

Here's result of command you use, I hope it helps:
http://pastebin.com/YW41Dpma

I found it quite confusing that .services without srv argument return nothing instead of all and those "-1"s in many places also look confusing. I followed code and considering _disk_io.ms doesn't seem to be set anywhere they're like hardcoded?

Permissions

It'd be really nice to have some flag indicating level of privilleges, especially for getAllData or maybe even autodetect because currently lib is crashing with EACCES on my os if not run as root.

Error: EACCES: permission denied, open '/sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_cur_freq'

si.cpuTemperatue is not a function

Does this mean that it's not supported by the cpu/os?

The error:

(node:9740) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 3): TypeError: si.cpuTemperatue is not a function

My code:

    private getTemperature(): Promise<number> {
        return new Promise<number>((resolve, reject) => {
            si.cpuTemperatue(resolve);
        });
    }

OS: Microsoft Windows 10 Pro

CPU Usage in %

Hello,
I liked your project.
But I'm kind of dumb and I do not know how to make my code look just like you.
Could you please review and include my code in your next version?
Thank you

exec("cat /proc/stat | grep cpu", function(error, stdout) {
                let lines = stdout.toString().trim().split('\n');
                lines.splice(0, 1);
                lines.forEach(function(line, index) {
                    let sline = line.split('\ ')
                    let pline = {
                        core: sline[0],
                        user: parseInt(sline[1]),
                        nice: parseInt(sline[2]),
                        system: parseInt(sline[3]),
                        idle: parseInt(sline[4]),
                        iowait: parseInt(sline[5])
                    };
                    let totalTime = pline.user + pline.nice + pline.system + pline.idle + pline.iowait;
                    pline.user = Number((pline.user * 100) / totalTime).toFixed(3);
                    pline.nice = Number((pline.nice * 100) / totalTime).toFixed(3);
                    pline.system = Number((pline.system * 100) / totalTime).toFixed(3);
                    pline.idle = Number((pline.idle * 100) / totalTime).toFixed(3);
                    pline.iowait = Number((pline.iowait * 100) / totalTime).toFixed(3);
                    lines[index] = pline;
                });
                resolve(lines);
            };

npm install failure

Hi Sebastian,

Perhaps I did something wrong, but npm install systeminformation --save appears not to work:

I am attaching file npm-debug.log.

npm-debug.txt

Also, here is the console output (though run without --save option):

[root@pb_stap251 ecxmon]# npm install systeminformation

> [email protected] install /home/ecxcc/ecxmon/node_modules/systeminformation
> node-gyp rebuild

make: Entering directory `/home/ecxcc/ecxmon/node_modules/systeminformation/build'
  SOLINK_MODULE(target) Release/obj.target/none.node
make: g++: Command not found
make: *** [Release/obj.target/none.node] Error 127
make: Leaving directory `/home/ecxcc/ecxmon/node_modules/systeminformation/build'
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:276:23)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Linux 2.6.32-642.11.1.el6.x86_64
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/ecxcc/ecxmon/node_modules/systeminformation
gyp ERR! node -v v7.2.1
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
npm ERR! Linux 2.6.32-642.11.1.el6.x86_64
npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "install" "systeminformation"
npm ERR! node v7.2.1
npm ERR! npm  v3.10.10
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the systeminformation package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs systeminformation
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls systeminformation
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /home/ecxcc/ecxmon/npm-debug.log

I am still able to run because I again downloaded 3.11.0 instead of 3.17.0.

Please let me know what's going on here; thanks!

Cordially,

Paul

Problem at linux with other locales than english

Hi,

Your work is great, only have one problem at some of my clients, they have a german locale at console. So there is only one problem at filesystem.js line #594 where you execute lshw to get disks. You are looking for the key "logical name" but i get at the clients "Logischer Name" cause of german locale. So i can't force them all to set console locale to english as default. Sure i can tell all they must have installed english as secondary locale.

The only real problem is that i get an error 'cat /sys/block/' + logical + '/queue/rotational' cause logical is empty at my case and so the dir it tries to cat does not exist.

At least i need a fix for checking if the dir exists before cat'ing it (think those two lines are not to hard to you so i don't have to send a pull request ;) )

But much better would be a solution to get the devices at systems with other default locale than english too. I'm 100% sure at the moment how to solve this, but maybe you have an idea :)

not sure if it's possible to maybe forcing the console output to english (like i said, i can install a second locale), but maybe you/we find a solution where it's not important which locale is installed (maybe catching it not by key, catching it by something like substring with /dev/?... just one more idea ;) )

greetings
Chris

Units for the different properties

I'd like to know what unit si.mem.total uses, and maybe add it to the readme.

I thought it was bytes, but when I used si.mem, I got

8494383104
Which in GB is 8.49~
While Windows tells me that I have 8.00

Thanks in advance.

Enhancement request

Hi Sebastian,

When you are able to address issue #21 might you be able to make a modest (I think) enhancement to the list of process properties returned by si.processes(cb)?

Specifically, could that list include for each returned process object not only pcpu, but its decomposition into system (kernel) CPU utilization and user CPU utilization?

Not that you need it, but vide: http://unix.stackexchange.com/questions/132035/obtain-user-and-kernel-time-of-a-running-process

Thanks.

-Paul

Not reliable `getFirstExternalNetworkInterface` function

Hi, I'm reading the code of your library and I think you are using the getFirstExternalNetworkInterface function to get the current active interface in the system to start monitoring the data transfer speed.

If I'm correct about this, there's a problem with that function and is not reliable.

Note: I'm using OS X

If I have my WiFi connection active and I'm also connected to wired using the thunderbolt port the os.networkInterfaces() execution will return this:

{
  lo0: [
    { 
      address: '::1',
      netmask: 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff',
      family: 'IPv6',
      mac: '00:00:00:00:00:00',
      scopeid: 0,
      internal: true
    },
    {
      address: '127.0.0.1',
      netmask: '255.0.0.0',
      family: 'IPv4',
      mac: '00:00:00:00:00:00',
      internal: true
    },
    {
      address: 'fe80::1',
      netmask: 'ffff:ffff:ffff:ffff::',
      family: 'IPv6',
      mac: '00:00:00:00:00:00',
      scopeid: 1,
      internal: true
    }
  ],
  en0: [
    {
      address: 'fe80::bae8:56ff:fe44:f972',
      netmask: 'ffff:ffff:ffff:ffff::',
      family: 'IPv6',
      mac: 'b8:e8:56:44:f9:72',
      scopeid: 4,
      internal: false
    },
    {
      address: '10.229.128.75',
      netmask: '255.255.0.0',
      family: 'IPv4',
      mac: 'b8:e8:56:44:f9:72',
      internal: false
    }
  ],
  awdl0: [
    {
      address: 'fe80::c4ff:94ff:feae:e2e2',
      netmask: 'ffff:ffff:ffff:ffff::',
      family: 'IPv6',
      mac: 'c6:ff:94:ae:e2:e2',
      scopeid: 8,
      internal: false
    }
  ],
  utun1: [
    {
      address: 'fe80::d006:2732:5299:2715',
      netmask: 'ffff:ffff:ffff:ffff::',
      family: 'IPv6',
      mac: '00:00:00:00:00:00',
      scopeid: 11,
      internal: false
    }
  ],
  en5: [
    {
      address: 'fe80::ca2a:14ff:fe4c:1543',
      netmask: 'ffff:ffff:ffff:ffff::',
      family: 'IPv6',
      mac: 'c8:2a:14:4c:15:43',
      scopeid: 12,
      internal: false
    },
    {
      address: '10.225.128.233',
      netmask: '255.255.0.0',
      family: 'IPv4',
      mac: 'c8:2a:14:4c:15:43',
      internal: false
    }
  ]
}

With this data, the getFirstExternalNetworkInterface will return en0 as the active interface which is correct, but if I turn off my WiFi device and and execute the os.networkInterfaces() method again the output will be this:

{
  lo0: [
    { 
      address: '::1',
      netmask: 'ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff',
      family: 'IPv6',
      mac: '00:00:00:00:00:00',
      scopeid: 0,
      internal: true
    },
    {
      address: '127.0.0.1',
      netmask: '255.0.0.0',
      family: 'IPv4',
      mac: '00:00:00:00:00:00',
      internal: true
    },
    {
      address: 'fe80::1',
      netmask: 'ffff:ffff:ffff:ffff::',
      family: 'IPv6',
      mac: '00:00:00:00:00:00',
      scopeid: 1,
      internal: true
    }
  ],
  utun1: [
    {
      address: 'fe80::d006:2732:5299:2715',
      netmask: 'ffff:ffff:ffff:ffff::',
      family: 'IPv6',
      mac: '00:00:00:00:00:00',
      scopeid: 11,
      internal: false
    }
  ],
  en5: [
    {
      address: 'fe80::ca2a:14ff:fe4c:1543',
      netmask: 'ffff:ffff:ffff:ffff::',
      family: 'IPv6',
      mac: 'c8:2a:14:4c:15:43',
      scopeid: 12,
      internal: false
    },
    {
      address: '10.225.128.233',
      netmask: '255.255.0.0',
      family: 'IPv4',
      mac: 'c8:2a:14:4c:15:43',
      internal: false
    }
  ]
}

And the getFirstExternalNetworkInterface will return utun1 as the active interface which is incorrect, since the current active interface is en5.

I see two problems here...

  • You are relaying in the internal === false value to determine which is the active interface
  • You are trying to get the first value of an object which is a non-ordered structure

typescript definitions

The best option is to maintain this with the library instead of having a @types package IMO.
We can provide a d.ts or convert the project to typescript, I prefer the last option but I can contribute to the first one too.

UnhandledPromiseRejectionWarning

Hi! Great package, really appreciate your work!

It works without problems on my PC and even Raspberry PI 2 :) , but I have problem while running this simple test program on my laptop:

var si = require('systeminformation');

si.getStaticData(function (data) {
    console.log(data);
});

In the console instead of static informations about by laptop I get this:
UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: not supported
Any idea what may cause this error? My laptop is Samsung QX310, running on Windows 10 Pro (same version as on my PC), maybe it's something about my laptops hardware? :|

windows: add si.processes

This command will show you a list of running processes. Required powershell@v3.

powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "get-wmiobject win32_process | select ProcessId, Name, @{Name='StartTime'; Expression = { $_.ConvertToDateTime($_.CreationDate) }} | convertto-json -compress"

Fields:

Field process property description
ProcessId [0].pid process pid
Priority [0].priority process priotity
PageFileUsage [0].mem_vsz process virtual memory size in kb
WorkingSetSize [0].mem_rss process mem resident set size in bytes
@{Name='StartTime'; Expression = { $_.ConvertToDateTime($_.CreationDate) }} [0].started process start time
@{Name='Owner'; Expression = { $_.GetOwner().User }} [0].user user who started process (note: this operation is very slow)
CommandLine [0].command process starting command
UserModeTime - cpu user time in 100-nanosecond units
KernelModeTime - cpu system time is 100-nanosecond units

How to convert 100-nanosecond units to ms

CPU usage in % ([0].pcpu) can be calculated like this:

cpu = (UserModeTime + KernelModeTime) / (now - StartTime) * 100

You can see this fields in action in my package process-list

cpu.js Speed & Brand detection doesn't work with AMD processors

[path]\node_modules\systeminformation\lib\cpu.js:165
            result.speed = name.split('@')[1].trim();
                                             ^

TypeError: Cannot read property 'trim' of undefined
    at [path]\node_modules\systeminformation\lib\cpu.js:165:46
    at ChildProcess.exithandler (child_process.js:197:7)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:194:7)
    at maybeClose (internal/child_process.js:899:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:226:5)

This happens because the name string describing AMD processors doesn't contain the necessary data.
Sample name: 'AMD FX(tm)-8320 Eight-Core Processor'

Data is not accurate

Hi,
I found out that some data is not accurate, for example the loadavg and the cpu used by process (pcpu) have different values if you compare with top or htop command

Missing Validation in osInfo (Windows)

I was trying your lib (btw, nice job) and in the osInfo function you missed a validation for Windows logo that throws:

C:\Users\Fxckdead\Desktop\testing\node_modules\systeminformation\lib\osinfo.js:43
  distro = distro.toLowerCase();
                 ^

TypeError: Cannot read property 'toLowerCase' of undefined
    at getLogoFile (C:\Users\Fxckdead\Desktop\testing\node_modules\systeminformation\lib\osinfo.js:43:18)

In that line i can see:

// Get logo filename of OS distribution

function getLogoFile(distro) {
  distro = distro.toLowerCase(); // <-- THIS LINE 

For the windows version you don't send the distro param, so toLowerCase is not an string:

197    if (_windows) {
198        result.logofile = getLogoFile();

I can't send a pull request right now, but its an easy fix.

JSON.parse error for octal character

It seems that si.blockDevices() doesn't handle octal string.
My node program was exited abnormally when this error occurs.

Is there any way to avoid this error when using si.blockDevices()?

{"name":"sda1" ,"type":"part" ,"size":"471859200" ,"fstype":"ntfs" ,"mountpoint":"" ,"uuid":"E29E89789E8945CF" ,"rota":"0" ,"ro":"0" ,"rm":"0" ,"tran":"" ,"serial":"" ,"label":"\xeb\xb3\xb5\xea\xb5\xac" ,"model":"" ,"owner":"root"}
                                                                                                                                                                                  ^

SyntaxError: Unexpected token x in JSON at position 178
    at JSON.parse (<anonymous>)
    at lines.filter.forEach (/snapshot/home/nemoux/nemosolution/nemocloud/admin-backend/node_modules/systeminformation/lib/filesystem.js:153:21)
    at Array.forEach (native)
    at parseBlk (/snapshot/home/nemoux/nemosolution/nemocloud/admin-backend/node_modules/systeminformation/lib/filesystem.js:152:37)
    at /snapshot/home/nemoux/nemosolution/nemocloud/admin-backend/node_modules/systeminformation/lib/filesystem.js:205:20
    at ChildProcess.exithandler (child_process.js:202:7)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:192:7)
    at maybeClose (internal/child_process.js:890:16)

Thank you in advance.

SocketIO

Hi,
First of all congratulations for this amazing project.
I have two questions:
1ºDo you have any example using socket io for real-time monitor?
2ºUsing si.processes(cb) how can I get only the running proccess?

Best regards

si.diskLayout on CentOS 7 (systemd-based)

Hi Sebastian,

Using 3.17.2 on CentOS 7 si.diskLayout(cb) returns an empty (pending) promise which is never fulfilled, e.g.,

[root@localhost ecxmon]# node
> var si = require('systeminformation')
undefined
> si.diskLayout(function(d) {console.log(d)})
Promise { <pending> }
> []

FWIW si.memLayout() works. I haven't tried on a non-systemd platform.

Thanks.

-Paul

question about list returned by si.processes()

Hi Sebastian,

Happy New Year & hope you are well.

The process object returned under si.processes().list contains a 'pcpu' (percent CPU utilization) field. How should I interpret this number on a multi-core machine?

I here have in mind the difference between the top command's Irix (the default, I think) and Solaris modes. In the former, %CPU is not divided by the number of cores; in the latter it is.

As always, thanks for your help.

Cordially,

Paul

SWAP is NaN

Because free in version 3.3.10 doesn't display -/+ buffers/cache any more, there's only two columns and line 3 (for swap) just doesn't exist.

A simple fix could be to count number of lines and act consequently…

systeminformation not installing on Windows

Here is the debug log:
npm_debug_log.txt

I ran the command "npm install systeminformation --save" but ended up getting these errors:

$ npm install systeminformation --save
npm WARN package.json [email protected] license should be a valid SPDX license expression

[email protected] install D:\GamingHub\Gamempire\node_modules\systeminformation
node-gyp rebuild

D:\GamingHub\Gamempire\node_modules\systeminformation>if not defined npm_config_node_gyp (node "D:\Program Files\nodejs\node_modules\npm\bin\node-gyp-bin\....\node_modules\node-gyp\bin\node-gyp.js" rebuild ) else (node "" rebuild )
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
MSBUILD : error MSB3428: Could not load the Visual C++ component "VCBuild.exe". To fix this, 1) install the .NET Framework 2.0 SDK, 2) install Microsoft Visual Studio 2005 or 3) add the location of the component to the system path if it is installed elsewhere. [D:\GamingHub\Gamempire\node_modules\systeminformation\build\binding.sln]
gyp ERR! build error
gyp ERR! stack Error: C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild.exe failed with exit code: 1
gyp ERR! stack at ChildProcess.onExit (D:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\build.js:276:23)
gyp ERR! stack at emitTwo (events.js:87:13)
gyp ERR! stack at ChildProcess.emit (events.js:172:7)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Windows_NT 6.3.9600
gyp ERR! command "D:\Program Files\nodejs\node.exe" "D:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd D:\GamingHub\Gamempire\node_modules\systeminformation
gyp ERR! node -v v4.6.1
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "D:\Program Files\nodejs\node.exe" "D:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install" "systeminformation" "--save"
npm ERR! node v4.6.1
npm ERR! npm v2.15.9
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the systeminformation package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs systeminformation
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!
npm ERR! npm owner ls systeminformation
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! D:\GamingHub\Gamempire\npm-debug.log

At first, there was also a python error, trying to run 3.3.0 which isn't supported in this module so I renamed my python 3.3.0 exe file to python3 so it recognized my 2.7.8 version. But now, I'm not sure what to do. I also tried to download it through github and put the module in my node_module folder but that didn't work, got this error:

Error: Cannot find module '../build/Release/smc' from 'D:\GamingHub\Gamempire\node_modules\systeminformation\lib'

Error installing - Failed at node-gyp rebuild

I get this while installing.

gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack at failNoPython (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:449:14)
gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:404:11
gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\graceful-fs\polyfills.js:264:29
gyp ERR! stack at FSReqWrap.oncomplete (fs.js:123:15)
gyp ERR! System Windows_NT 10.0.14393
gyp ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\Owner\Documents\GitHub\eth\node_modules\systeminformation
gyp ERR! node -v v6.9.4
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok
npm WARN [email protected] No repository field.
npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\Program Files\nodejs\node.exe" "C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js" "install" "systeminformation" "--save"
npm ERR! node v6.9.4
npm ERR! npm v3.10.10
npm ERR! code ELIFECYCLE

npm ERR! [email protected] install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the systeminformation package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs systeminformation
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls systeminformation
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR! C:\Users\Owner\Documents\GitHub\eth\npm-debug.log`

Temperature Returns Innacurate Data

Using cputemperature to measure the temperature of my CPU, I get these values:

{ main: -172.86666666666667, cores: [ -273.2, -273.2, 27.8 ], max: -1 }

My CPU only has two cores but it is indicated that there are three.

Also, I haven't checked using any other software, but I'm fairly sure my CPU isn't at Absolute Zero.

Is this an issue with the sensors on my CPU?

How to use import systeminformation on react.js project

Hi,
I can't import this syteminformation.js on my react.js project. I worked this on Mac OS 10.11.6.
After run 'npm install systeminformation --save" command, I added a line in my line:
import si from 'systeminformation';

Then I got issue:
ERROR in ./ ~ /systeminformation/lib/cpu.js
Module not found: Error: Cannot resolve 'file' or 'directory' ../build/Release/smc in /Users/pascal/Sites/key/keytabs/node_modules/systeminformation/lib
@ ./ ~ /systeminformation/lib/cpu.js 251:18-49

Please help me how to fix this issue.

Race condition?

Hi Sebastian,

This issue appears to be similar to #14 which you fixed for us last November.

But in this case it is si.processes() - and not si.currentLoad() - that may prove problematic. I say "may" because I am always willing to allow that this problem is of my making.

My web browser client is presenting 2 d3.js plots simultaneously. In the Node.js backend this is realized as two "overlapped" (roughly concurrent) calls to si.processes(). I will paste in the code below.

If I display the process CPU utilization plot by itself, data values returned by si.processes() seem fine. But if I display both process CPU utilization & the process memory utilization plots at the same time, then the data returned by si.processes() assumes quite a few incorrect values. E.g., "Infinity", "NaN", and negative CPU utilizations.

In the code below, the 2 "collector" functions, one for CPU utilization, the other for memory, run "concurrently" (well, not really, but in the Node.js idiom). Each calls si.processes() and then calls function getProcessesOfInterest .

Thanks for your help.

Cordially,

Paul

function collectorProcessCpuUtil(monSessState, publisher)
{
    var cmdProgress = {
       entity: 'process',
       cpu_util: -1,                                                                               
       sid: monSessState.monSid,
       timestamp: (new Date).getTime(),
    };

    var mo = getMetricEntryFromSubDoc(monSessState.subDoc, cmdProgress.entity + '.cpu_util');     
    mo.push = true;   
   
    si.processes().then(data => getProcessesOfInterest('cpu_util', data, cmdProgress, publisher, false))                            
	          .catch(error => logMsg('info', 'process cpu_util si.processes error=' + error));
}


function collectorProcessMemUtil(monSessState, publisher)
{
    var cmdProgress = {
       entity: 'process',
       mem_util: -1,                                                                               
       sid: monSessState.monSid,
       timestamp: (new Date).getTime(),
    };
    
    var mo = getMetricEntryFromSubDoc(monSessState.subDoc, cmdProgress.entity + '.mem_util');     
    mo.push = true;   

    si.processes().then(data => getProcessesOfInterest('mem_util', data, cmdProgress, publisher, false))                            
	          .catch(error => logMsg('info', 'process mem_util si.processes error=' + error));
}


function getProcessesOfInterest(cmdId, data, cmdProgress, publisher, useProcessCache) 
{
	var nodeIp = app.get('localIp');
	var monSessState = app.get(cmdProgress.sid);
	
	var pCache = arrayToHash(data.list, 'pid'); 
	var numCores = monSessState.cpuInfo.cores;   // always 4
	
	var mo = getMetricEntryFromSubDoc(monSessState.subDoc, 'process.' + cmdId);
	var valAr = [];

	mo.pids.forEach(function(wantedPid){
		if ( pCache[wantedPid] )                                                                               // FTI we found pid that caller's interested in                                
		{
			var proc = pCache[wantedPid];                                                                  // get process object given us by si.processes
			
			if ( cmdId == 'cpu_util' )
			{				
			    var temp = parseFloat(numCores*proc.pcpu/100);
			    valAr.push({pid: wantedPid, util: parseFloat(numCores*proc.pcpu/100).toFixed(2)});         // ut returned by si is divided by # cores; undo that to present simpler metric
			}
			
			if ( cmdId == 'mem_util' )
			{
			    var temp = parseFloat(proc.pmem/100);
			    valAr.push({pid: wantedPid, util: parseFloat(proc.pmem/100).toFixed(2)});  				
			}
		}
	});

	cmdProgress[cmdId] = [{time: cmdProgress.timestamp, data: valAr}];
	publisher(cmdProgress);
}

CentOS 7 problems

Hi,

First, thank you very much for this fine piece of work! It's been a great help to me.

I was today experimenting with the several docker APIs offered by your module and it seems that two of them don't work in CentOS 7. I presume that this is perhaps more a systemd issue than anything else.

In response to, for example, si.dockerContainers('all', function(d) { console.log(d); }) I see:

Promise { <pending> }
> []

I get the same empty promise array in response to .dockerAll(cb). But .dockerContainerStats(ctrID, cb) seems to work fine.

All API calls work properly on CentOS 6 (and on Ubuntu 16.04).

Do these phenomena comport with your experience? If this is a valid new issue, is it something that can be fixed without too much work?

Thank you again.

Cordially,

Paul

Behavior of si.fsSize() ?

Hi Sebastian,

It seems to me that fsSize reports accurately only the first disk if finds, e.g., /dev/sda. In the output below I see partitions /dev/sda1 and /dev/sda3, but not /dev/sda2. I also don't see /dev/sda (the disk itself as opposed to its partitions.) Nor is the /dev/mapper data correct. Finally, devices /dev/sdb and /dev/sdc do not appear at all.

Am I missing something in my use of fsSize? If not, is this something that you can, without too much difficulty, enhance to include all disks and partitions?

As always, thank you.

-Paul

> si.fsSize(function(d) {console.log(d)} )
Promise { <pending> }
> [ { fs: '/dev/sda3',
    size: 14793351168,
    used: 4366913536,
    use: 29.52,
    mount: '/' },
  { fs: '/dev/sda1',
    size: 251575296,
    used: 108223488,
    use: 43.02,
    mount: '/boot' },
  { fs: '/dev/mapper/data_vg-data',
    size: NaN,
    used: NaN,
    use: NaN,
    mount: '/dev/mapper/data_vg-data' },
  { fs: '/dev/mapper/data2_vg-data2',
    size: NaN,
    used: NaN,
    use: NaN,
    mount: '/dev/mapper/data2_vg-data2' } ]

On this particular host (a CentOS6 VMware VM), the disks are as follows (this via fdisk):

Disk /dev/sda: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000a3b96

Disk /dev/sdb: 107.4 GB, 107374182400 bytes
255 heads, 63 sectors/track, 13054 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0xdded8033


Disk /dev/sdc: 268.4 GB, 268435456000 bytes
255 heads, 63 sectors/track, 32635 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x921b17e3

And here, a bit redundantly, is the output from 'fdisk -l' which also shows the partitions:

Disk /dev/sda: 32.2 GB, 32212254720 bytes
255 heads, 63 sectors/track, 3916 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x000a3b96

   Device Boot      Start         End      Blocks   Id  System
/dev/sda1   *           1          33      262144   83  Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2              33        2073    16384000   82  Linux swap / Solaris
/dev/sda3            2073        3917    14810112   83  Linux

Disk /dev/sdb: 107.4 GB, 107374182400 bytes
255 heads, 63 sectors/track, 13054 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/sdc: 268.4 GB, 268435456000 bytes
255 heads, 63 sectors/track, 32635 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/data2_vg-data2: 268.4 GB, 268431261696 bytes
255 heads, 63 sectors/track, 32634 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000


Disk /dev/mapper/data_vg-data: 107.4 GB, 107369988096 bytes
255 heads, 63 sectors/track, 13053 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

Using Raspbian on a Raspberry pi zero W doesn't retrieve any graphics info

Hi,

I'm currently using your package for retrieval of the graphics information of the system. On my windows device I get the information I need ( resolution of all connected displays). On my raspberry pi zero W on the other hand I get the following:

{
"controllers": [],
"displays": [
{
"connection": "default",
"main": false,
"builtin": false
}
]
}

"mem is not a function" using si.getAllData()

Hello, I get this error when using si.getAllData():

node_modules/systeminformation/lib/index.js:267
      mem().then(res => {
      ^

TypeError: mem is not a function
    at process.nextTick (node_modules/systeminformation/lib/index.js:267:7)
    at _combinedTickCallback (internal/process/next_tick.js:67:7)
    at process._tickCallback (internal/process/next_tick.js:98:9)

I'm on Arch Linux (4.7.2-1-ARCH #1 SMP PREEMPT Sat Aug 20 23:02:56 CEST 2016 x86_64 GNU/Linux), Node v8.1.2, "systeminformation": "^3.23.3" in package.json.

si.currentLoad race conditions?

Hi Sebastian,

Before I start posting massive debug log output, are you aware of any potential race issues with this (or any other) si call?

The basic conditions & sequence are as follows:

  1. backend https server (Node.js, express.js) periodically (every 5 seconds) drive si.currentLoad using promise idiom (see below).
  2. client 1 web browser connects
  3. data pushed back to client 1 looks correct
  4. client 2 web browser connects
  5. data pushed back to client 2 looks incorrect
si.currentLoad().then(data => parseCpuLoadInfo('cpu_util', data, cmdProgress, responder))      
                         .catch(error => logMsg('info', 'si.currentLoad error=' + error));

When item 4 above says "incorrect", I mean that the several metrics returned by this call (currentload, currentload_system, currentload_user, currentload_nice) are either null or incoherent, e.g., the client 1 data shows currentload of 1.004 but 5 seconds later currentload for client 2 shows 100. Note that there is nothing else running on the node. It might of some interest to note that the avgload property never shows a null or incoherent value, even if the other properties in the object do.

I realize that this could very well be my problem but, for the moment I don't see what I'm doing that might be causing this.

So I'd be grateful for any light you can shed on this.

Thanks.

-Paul

Laptop apparently doesn't use a battery.

When I execute the following code my laptop that runs on a battery, it returns "false".

var si = require('systeminformation');
si.battery(function (battery) {
console.log(battery.hasbattery);
});

I am using a Dell Laptop running Windows 10 using the latest version of System Information. Any ideas?

networkStats rx_sec, tx_sec always at -1 & fsStats rx_sec, wx_sec always at 0

Hey, thanks for your great module!

I tried on two different Ubuntu 16.04 machines, with both node 4.4.5 and 6.2.1.
The realtime metrics for networkStats and fsStats don't seem to work.

Exemple output:

…
networkStats: 
 { iface: 'eth0',
   operstate: 'unknown',
   rx: 0,
   tx: 0,
   rx_sec: -1,
   tx_sec: -1 },
…
fsStats: { rx: 455069696, wx: 4253657088, rx_sec: 0, wx_sec: 0 },
…

Change in content of si.processes?

Hi Sebastian,

It looks to me that the list array within the data returned by si.processes() no longer contains a proper command property. In fact, it looks to me as if the command property might contain the userid under which the process is running.

I'm fairly certain that I used to use the command property to help me identify processes of interest, e.g., various startup flags, etc.

I am using 3.17.0 version of si.

Can you confirm my findings?

Thanks.

-Paul

hard disk serial number

can you add support to hard disk serial number?

in windows the command is -
"wmic diskdrive get serialnumber"

it's different from -
"wmic logicaldisk get VolumeSerialNumber"

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.