From cd972d01cd36b9cf617afbb3136c589219cc8ec9 Mon Sep 17 00:00:00 2001 From: Sebastian Hildebrandt Date: Sun, 8 Mar 2020 23:26:54 +0100 Subject: [PATCH] updated docs --- docs/filesystem.html | 153 ++++++++++++++++++++++++++++++++++++++++ docs/network.html | 162 +++++++++++++++++++++++++++++++++++++++++++ docs/wifi.html | 35 ++++++++++ 3 files changed, 350 insertions(+) diff --git a/docs/filesystem.html b/docs/filesystem.html index c405e14..c38b181 100644 --- a/docs/filesystem.html +++ b/docs/filesystem.html @@ -235,6 +235,37 @@ S.M.A.R.T Status (see Known Issues) + + + +
Example
+
const si = require('systeminformation');
+si.diskLayout().then(data => console.log(data));
+
+[
+  {
+    device: '/dev/nvme0n1',
+    type: 'NVMe',
+    name: 'SAMSUNG xxxxxxxxxxxx-xxxx',
+    vendor: 'Samsung',
+    size: 1024209543168,
+    bytesPerSector: -1,
+    totalCylinders: -1,
+    totalHeads: -1,
+    totalSectors: -1,
+    totalTracks: -1,
+    tracksPerCylinder: -1,
+    sectorsPerTrack: -1,
+    firmwareRevision: '',
+    serialNum: '...serial....',
+    interfaceType: 'PCIe',
+    smartStatus: 'unknown'
+  },
+  {
+    ...
+  }
+]
+ si.blockDevices(cb) [{...}] @@ -365,6 +396,34 @@ protocol (SATA, PCI-Express, ...) + + + +
Example
+
const si = require('systeminformation');
+si.blockDevices().then(data => console.log(data));
+
+[
+  {
+    name: 'nvme0n1',
+    type: 'disk',
+    fstype: '',
+    mount: '',
+    size: 1024209543168,
+    physical: 'SSD',
+    uuid: '',
+    label: '',
+    model: 'SAMSUNG xxxxxxxxxxxx-xxxx',
+    serial: '... serial ...',
+    removable: false,
+    protocol: 'nvme',
+    group: undefined
+  },
+  {
+    ...
+  }
+]
+ si.disksIO(cb) {...} @@ -445,6 +504,36 @@ interval length (for per second values) + + + +
Example
+
const si = require('systeminformation');
+setInterval(function() {
+  si.disksIO().then(data => {
+    console.log(data);
+  })
+}, 1000)
+
+{                           // first call
+  rIO: 899825,
+  wIO: 932331,
+  tIO: 1832156,
+  rIO_sec: -1,
+  wIO_sec: -1,
+  tIO_sec: -1,
+  ms: 0
+}
+{                           // second call
+  rIO: 899863,
+  wIO: 932331,
+  tIO: 1832194,
+  rIO_sec: 38.5395537525355,
+  wIO_sec: 0,
+  tIO_sec: 38.5395537525355,
+  ms: 986
+}...
+

File System and File System Stats

@@ -532,6 +621,27 @@ mount point + + + +
Example
+
const si = require('systeminformation');
+si.fsSize().then(data => console.log(data));
+
+[
+  {
+    fs: '/dev/md2',
+    type: 'ext4',
+    size: 972577361920,
+    used: 59142635520,
+    use: 6.08,
+    mount: '/'
+  },
+  {
+    ...
+  }
+]
+ si.fsOpenFiles(cb) {...} @@ -572,6 +682,19 @@ count available + + + +
Example
+
const si = require('systeminformation');
+si.fsOpenFiles().then(data => console.log(data));
+
+{
+  max: 6566555,
+  allocated: 1856,
+  available: 0
+}
+ si.fsStats(cb) {...} @@ -652,6 +775,36 @@ interval length (for per second values) + + + +
Example
+
const si = require('systeminformation');
+setInterval(function() {
+  si.fsStats().then(data => {
+    console.log(data);
+  })
+}, 1000)
+
+{                             // first call
+  rx: 14015849472,
+  wx: 15316003328,
+  tx: 29331852800,
+  rx_sec: -1,
+  wx_sec: -1,
+  tx_sec: -1,
+  ms: 0
+}
+{                             // second call
+  rx: 14015849472,
+  wx: 15316007424,
+  tx: 29331856896,
+  rx_sec: 0,
+  wx_sec: 4083.748753738784,
+  tx_sec: 4083.748753738784,
+  ms: 1003
+}...
+

Getting correct stats values

diff --git a/docs/network.html b/docs/network.html index c1443b1..1fd28f4 100644 --- a/docs/network.html +++ b/docs/network.html @@ -245,6 +245,54 @@ # changes up/down + + + +
Example
+
const si = require('systeminformation');
+si.networkInterfaces().then(data => console.log(data));
+
+[
+  {
+    iface: 'lo0',
+    ifaceName: 'lo0',
+    ip4: '127.0.0.1',
+    ip6: '::1',
+    mac: '',
+    internal: true,
+    virtual: false,
+    operstate: 'down',
+    type: 'wired',
+    duplex: 'full',
+    mtu: 16384,
+    speed: -1,
+    dhcp: false,
+    dnsSuffix: '',
+    ieee8021xAuth: '',
+    ieee8021xState: '',
+    carrierChanges: 0
+  },
+  {
+    iface: 'en0',
+    ifaceName: 'en0',
+    ip4: '192.168.0.27',
+    ip6: 'fe80::134a:1e43:abc5:d413',
+    mac: 'xx:xx:xx:xx:xx:xx',
+    internal: false,
+    virtual: false,
+    operstate: 'up',
+    type: 'wired',
+    duplex: 'full',
+    mtu: 1500,
+    speed: 1000,
+    dhcp: true,
+    dnsSuffix: '',
+    ieee8021xAuth: '',
+    ieee8021xState: '',
+    carrierChanges: 0
+  }, ...
+]
+ si.networkInterfaceDefault(cb) : string @@ -255,6 +303,15 @@ X get name of default network interface + + + +
Example
+
const si = require('systeminformation');
+si.networkInterfaceDefault().then(data => console.log(data));
+
+eth0
+ si.networkGatewayDefault(cb) : string @@ -265,6 +322,15 @@ X get default network gateway + + + +
Example
+
const si = require('systeminformation');
+si.networkGatewayDefault().then(data => console.log(data));
+
+192.168.0.1
+ si.networkStats(iface,cb) [{...}] @@ -385,6 +451,48 @@ interval length (for per second values) + + + +
Example
+
const si = require('systeminformation');
+setInterval(function() {
+  si.networkStats().then(data => {
+    console.log(data);
+  })
+}, 1000)
+
+[
+  {                                 // first call
+    iface: 'en0',
+    operstate: 'up',
+    rx_bytes: 1752866207,
+    rx_dropped: 0,
+    rx_errors: 0,
+    tx_bytes: 180934681,
+    tx_dropped: 0,
+    tx_errors: 0,
+    rx_sec: -1,
+    tx_sec: -1,
+    ms: 0
+  }
+]
+[
+  {                                 // second call
+    iface: 'en0',
+    operstate: 'up',
+    rx_bytes: 1752866822,
+    rx_dropped: 0,
+    rx_errors: 0,
+    tx_bytes: 180939820,
+    tx_dropped: 0,
+    tx_errors: 0,
+    rx_sec: 624.3654822335026,
+    tx_sec: 5217.258883248731,
+    ms: 985
+  }
+]...
+ si.networkConnections(cb) [{...}] @@ -475,6 +583,37 @@ process name + + + +
Example
+
const si = require('systeminformation');
+si.networkConnections().then(data => console.log(data));
+
+[
+  {
+    protocol: 'tcp4',
+    localaddress: '192.168.0.27',
+    localport: '55788',
+    peeraddress: '163.128.xxx.xxx',
+    peerport: '443',
+    state: 'CLOSE_WAIT',
+    pid: 702,
+    process: ''
+  },
+  {
+    protocol: 'tcp4',
+    localaddress: '192.168.0.27',
+    localport: '55761',
+    peeraddress: '148.253.xxx.xxx',
+    peerport: '22',
+    state: 'ESTABLISHED',
+    pid: 7267,
+    process: ''
+  },
+  ...
+]
+

Site availability, Internet Latency

@@ -542,6 +681,20 @@ X response time in ms + + + +
Example
+
const si = require('systeminformation');
+si.inetChecksite('google.com').then(data => console.log(data));
+
+{
+  url: 'google.com',
+  ok: true,
+  status: 301,
+  ms: 82
+}
+ si.inetLatency(host, cb) : number @@ -552,6 +705,15 @@ X response-time (ms) to external resource
host parameter is optional (default 8.8.8.8) + + + +
Example
+
const si = require('systeminformation');
+si.inetLatency().then(data => console.log(data));
+
+13.484
+

Getting correct stats values

diff --git a/docs/wifi.html b/docs/wifi.html index c596e0b..081330b 100644 --- a/docs/wifi.html +++ b/docs/wifi.html @@ -175,6 +175,41 @@ array of RDN flags + + + +
Example
+
const si = require('systeminformation');
+si.wifiNetworks().then(data => console.log(data));
+
+[
+  {
+    ssid: 'INTERNAL-WIFI',
+    bssid: 'ab:01:14:4f:d3:82',
+    mode: '',
+    channel: 44,
+    frequency: 5220,
+    signalLevel: -68,
+    quality: 64,
+    security: [ 'WPA', 'WPA2' ],
+    wpaFlags: [ 'PSK/TKIP/TKIP', 'PSK/AES/TKIP' ],
+    rsnFlags: []
+  },
+  {
+    ssid: 'FREE Wifi',
+    bssid: 'aa:14:e5:16:97:f3',
+    mode: '',
+    channel: 44,
+    frequency: 5220,
+    signalLevel: -50,
+    quality: 100,
+    security: [ 'WPA', 'WPA2' ],
+    wpaFlags: [ 'PSK/TKIP/TKIP', 'PSK/AES/TKIP' ],
+    rsnFlags: []
+  },
+  ...
+]
+