sysiddr5 1.0.1-beta.2

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of sysiddr5 might be problematic. Click here for more details.

package/README.md ADDED
@@ -0,0 +1,885 @@
1
+ <h3 align="center">sysiddr5</h3>
2
+
3
+ ## Quick Start
4
+
5
+ Lightweight collection of 50+ functions to retrieve detailed hardware, system and OS information.
6
+
7
+ - simple to use
8
+ - get detailed information about system, cpu, baseboard, battery, memory, disks/filesystem, network, docker, software, services and processes
9
+ - supports Linux, macOS, partial Windows, FreeBSD, OpenBSD, NetBSD, SunOS and Android support
10
+ - no npm dependencies
11
+
12
+ ### Installation
13
+
14
+ ```bash
15
+ npm install sysiddr5 --save
16
+ ```
17
+
18
+ or simpler
19
+
20
+ ```bash
21
+ npm install sysiddr5
22
+ ```
23
+
24
+ ### Usage
25
+
26
+ All functions (except `version` and `time`) are implemented as asynchronous functions. Here a small example how to use them:
27
+
28
+ ```js
29
+ const si = require('sysiddr5');
30
+
31
+ // promises style - new since version 3
32
+ si.cpu()
33
+ .then(data => console.log(data))
34
+ .catch(error => console.error(error));
35
+ ```
36
+
37
+ ## Core concept
38
+
39
+ NodeJS 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.
40
+
41
+ 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.
42
+
43
+ If you have comments, suggestions & reports, please feel free to contact me!
44
+
45
+
46
+
47
+
48
+ ## Reference
49
+
50
+ #### 1. General
51
+
52
+ | Function | Result object | Linux | BSD | Mac | Win | Sun | Comments |
53
+ | ------------ | ------------- | ----- | --- | --- | --- | --- | --------------------------------- |
54
+ | si.version() | : string | X | X | X | X | X | lib version (no callback/promise) |
55
+ | si.time() | {...} | X | X | X | X | X | (no callback/promise) |
56
+ | | current | X | X | X | X | X | local (server) time |
57
+ | | uptime | X | X | X | X | X | uptime in number of seconds |
58
+ | | timezone | X | X | X | X | X | e.g. GMT+0200 |
59
+ | | timezoneName | X | X | X | X | X | e.g. CEST |
60
+
61
+ #### 2. System (HW)
62
+
63
+ | Function | Result object | Linux | BSD | Mac | Win | Sun | Comments |
64
+ | ---------------- | ------------- | ----- | --- | --- | --- | --- | -------------------------------- |
65
+ | si.system(cb) | {...} | X | X | X | X | | hardware information |
66
+ | | manufacturer | X | X | X | X | | e.g. 'MSI' |
67
+ | | model | X | X | X | X | | model/product e.g. 'MS-7823' |
68
+ | | version | X | X | X | X | | version e.g. '1.0' |
69
+ | | serial | X | X | X | X | | serial number |
70
+ | | uuid | X | X | X | X | | UUID |
71
+ | | sku | X | X | X | X | | SKU number |
72
+ | | virtual | X | X | | X | | is virtual machine |
73
+ | | virtualHost | X | X | | X | | virtual host (if virtual) |
74
+ | | raspberry | X | | | | | optional raspberry revision data |
75
+ | si.bios(cb) | {...} | X | X | X | X | | bios information |
76
+ | | vendor | X | X | X | X | | e.g. 'AMI' |
77
+ | | version | X | X | X | X | | version |
78
+ | | releaseDate | X | X | | X | | release date |
79
+ | | revision | X | X | | X | | revision |
80
+ | | serial | X | | | X | | serial |
81
+ | si.baseboard(cb) | {...} | X | X | X | X | | baseboard information |
82
+ | | manufacturer | X | X | X | X | | e.g. 'ASUS' |
83
+ | | model | X | X | X | X | | model / product name |
84
+ | | version | X | X | X | X | | version |
85
+ | | serial | X | X | X | X | | serial number |
86
+ | | assetTag | X | X | X | X | | asset tag |
87
+ | | memMax | X | | X | X | | max memory in bytes |
88
+ | | memSlots | X | | X | X | | memory slots on baseboard |
89
+ | si.chassis(cb) | {...} | X | X | X | X | | chassis information |
90
+ | | manufacturer | X | X | X | X | | e.g. 'MSI' |
91
+ | | model | X | X | X | X | | model / product name |
92
+ | | type | X | X | X | X | | model / product name |
93
+ | | version | X | X | X | X | | version |
94
+ | | serial | X | X | X | X | | serial number |
95
+ | | assetTag | X | X | X | X | | asset tag |
96
+ | | sku | | | | X | | SKU number |
97
+
98
+ #### 3. CPU
99
+
100
+ | Function | Result object | Linux | BSD | Mac | Win | Sun | Comments |
101
+ | ---------------------- | ---------------- | ----- | --- | --- | --- | --- | ----------------------------------- |
102
+ | si.cpu(cb) | {...} | X | X | X | X | | CPU information |
103
+ | | manufacturer | X | X | X | X | | e.g. 'Intel(R)' |
104
+ | | brand | X | X | X | X | | e.g. 'Core(TM)2 Duo' |
105
+ | | speed | X | X | X | X | | in GHz e.g. '3.40' |
106
+ | | speedMin | X | | X | X | | in GHz e.g. '0.80' |
107
+ | | speedMax | X | X | X | X | | in GHz e.g. '3.90' |
108
+ | | governor | X | | | | | e.g. 'powersave' |
109
+ | | cores | X | X | X | X | | # cores |
110
+ | | physicalCores | X | X | X | X | | # physical cores |
111
+ | | efficiencyCores | X | | X | | | # efficiency cores |
112
+ | | performanceCores | X | | X | | | # performance cores |
113
+ | | processors | X | X | X | X | | # processors |
114
+ | | socket | X | X | | X | | socket type e.g. "LGA1356" |
115
+ | | vendor | X | X | X | X | | vendor ID |
116
+ | | family | X | X | X | X | | processor family |
117
+ | | model | X | X | X | X | | processor model |
118
+ | | stepping | X | X | X | X | | processor stepping |
119
+ | | revision | X | | X | X | | revision |
120
+ | | voltage | | X | | | | voltage |
121
+ | | flags | X | X | X | X | | CPU flags |
122
+ | | virtualization | X | X | X | X | | virtualization supported |
123
+ | | cache | X | X | X | X | | cache in bytes (object) |
124
+ | | cache.l1d | X | X | X | X | | L1D (data) size |
125
+ | | cache.l1i | X | X | X | X | | L1I (instruction) size |
126
+ | | cache.l2 | X | X | X | X | | L2 size |
127
+ | | cache.l3 | X | X | X | X | | L3 size |
128
+ | si.cpuFlags(cb) | : string | X | X | X | X | | CPU flags |
129
+ | si.cpuCache(cb) | {...} | X | X | X | X | | CPU cache sizes |
130
+ | | l1d | X | X | X | X | | L1D size |
131
+ | | l1i | X | X | X | X | | L1I size |
132
+ | | l2 | X | X | X | X | | L2 size |
133
+ | | l3 | X | X | X | X | | L3 size |
134
+ | si.cpuCurrentSpeed(cb) | {...} | X | X | X | X | X | current CPU speed (in GHz) |
135
+ | | avg | X | X | X | X | X | avg CPU speed (all cores) |
136
+ | | min | X | X | X | X | X | min CPU speed (all cores) |
137
+ | | max | X | X | X | X | X | max CPU speed (all cores) |
138
+ | | cores | X | X | X | X | X | CPU speed per core (array) |
139
+ | si.cpuTemperature(cb) | {...} | X | X | X* | X | | CPU temperature in C (if supported) |
140
+ | | main | X | X | X | X | | main temperature (avg) |
141
+ | | cores | X | X | X | X | | array of temperatures |
142
+ | | max | X | X | X | X | | max temperature |
143
+ | | socket | X | | | | | array socket temperatures |
144
+ | | chipset | X | | | | | chipset temperature |
145
+
146
+ #### 4. Memory
147
+
148
+ | Function | Result object | Linux | BSD | Mac | Win | Sun | Comments |
149
+ | ---------------- | --------------------- | ----- | --- | --- | --- | --- | -------------------------------------- |
150
+ | si.mem(cb) | {...} | X | X | X | X | X | Memory information (in bytes) |
151
+ | | total | X | X | X | X | X | total memory in bytes |
152
+ | | free | X | X | X | X | X | not used in bytes |
153
+ | | used | X | X | X | X | X | used (incl. buffers/cache) |
154
+ | | active | X | X | X | X | X | used actively (excl. buffers/cache) |
155
+ | | buffcache | X | X | X | | X | used by buffers+cache |
156
+ | | buffers | X | | | | | used by buffers |
157
+ | | cached | X | | | | | used by cache |
158
+ | | slab | X | | | | | used by slab |
159
+ | | available | X | X | X | X | X | potentially available (total - active) |
160
+ | | swaptotal | X | X | X | X | X | |
161
+ | | swapused | X | X | X | X | X | |
162
+ | | swapfree | X | X | X | X | X | |
163
+ | si.memLayout(cb) | [{...}] | X | X | X | X | | Memory Layout (array) |
164
+ | | [0].size | X | X | X | X | | size in bytes |
165
+ | | [0].bank | X | X | | X | | memory bank |
166
+ | | [0].type | X | X | X | X | | memory type |
167
+ | | [0].clockSpeed | X | X | X | X | | clock speed |
168
+ | | [0].formFactor | X | X | | X | | form factor |
169
+ | | [0].manufacturer | X | X | X | X | | manufacturer |
170
+ | | [0].partNum | X | X | X | X | | part number |
171
+ | | [0].serialNum | X | X | X | X | | serial number |
172
+ | | [0].voltageConfigured | X | X | | X | | voltage conf. |
173
+ | | [0].voltageMin | X | X | | X | | voltage min |
174
+ | | [0].voltageMax | X | X | | X | | voltage max |
175
+
176
+ #### 5. Battery
177
+
178
+ | Function | Result object | Linux | BSD | Mac | Win | Sun | Comments |
179
+ | -------------- | ---------------- | ----- | --- | --- | --- | --- | --------------------------------- |
180
+ | si.battery(cb) | {...} | X | X | X | X | | battery information |
181
+ | | hasBattery | X | X | X | X | | indicates presence of battery |
182
+ | | cycleCount | X | | X | | | numbers of recharges |
183
+ | | isCharging | X | X | X | X | | indicates if battery is charging |
184
+ | | designedCapacity | X | | X | X | | max capacity of battery (mWh) |
185
+ | | maxCapacity | X | | X | X | | max capacity of battery (mWh) |
186
+ | | currentCapacity | X | | X | X | | current capacity of battery (mWh) |
187
+ | | capacityUnit | X | | X | X | | capacity unit (mWh) |
188
+ | | voltage | X | | X | X | | current voltage of battery (V) |
189
+ | | percent | X | X | X | X | | charging level in percent |
190
+ | | timeRemaining | X | | X | | | minutes left (if discharging) |
191
+ | | acConnected | X | X | X | X | | AC connected |
192
+ | | type | X | | X | | | battery type |
193
+ | | model | X | | X | | | model |
194
+ | | manufacturer | X | | X | | | manufacturer |
195
+ | | serial | X | | X | | | battery serial |
196
+
197
+ * See known issues if you have a problem with macOS temperature or windows temperature
198
+
199
+ #### 6. Graphics
200
+
201
+ | Function | Result object | Linux | BSD | Mac | Win | Sun | Comments |
202
+ | --------------- | ------------------------- | ----- | --- | --- | --- | --- | ------------------------------------------- |
203
+ | si.graphics(cb) | {...} | X | | X | X | | arrays of graphics controllers and displays |
204
+ | | controllers[] | X | | X | X | | graphics controllers array |
205
+ | | ...[0].vendor | X | | X | X | | e.g. ATI |
206
+ | | ...[0].vendorId | | | X | | | vendor ID |
207
+ | | ...[0].model | X | | X | X | | graphics controller model |
208
+ | | ...[0].deviceId | | | X | | | device ID |
209
+ | | ...[0].bus | X | | X | X | | on which bus (e.g. PCIe) |
210
+ | | ...[0].vram | X | | X | X | | VRAM size (in MB) |
211
+ | | ...[0].vramDynamic | X | | X | X | | true if dynamically allocated ram |
212
+ | | ...[0].external | | | X | | | is external GPU |
213
+ | | ...[0].cores | | | X | | | Apple silicon only |
214
+ | | ...[0].metalVersion | | | X | | | Apple Metal Version |
215
+ | | displays[] | X | | X | X | | monitor/display array |
216
+ | | ...[0].vendor | | | | X | | monitor/display vendor |
217
+ | | ...[0].vendorId | | | X | | | vendor ID |
218
+ | | ...[0].deviceName | | | | X | | e.g. \\\\.\\DISPLAY1 |
219
+ | | ...[0].model | X | | X | X | | monitor/display model |
220
+ | | ...[0].productionYear | | | X | | | production year |
221
+ | | ...[0].serial | | | X | | | serial number |
222
+ | | ...[0].displayId | | | X | | | display ID |
223
+ | | ...[0].main | X | | X | X | | true if main monitor |
224
+ | | ...[0].builtin | X | | X | | | true if built-in monitor |
225
+ | | ...[0].connection | X | | X | X | | e.g. DisplayPort or HDMI |
226
+ | | ...[0].sizeX | X | | | X | | size in mm horizontal |
227
+ | | ...[0].sizeY | X | | | X | | size in mm vertical |
228
+ | | ...[0].pixelDepth | X | | X | X | | color depth in bits |
229
+ | | ...[0].resolutionX | X | | X | X | | pixel horizontal |
230
+ | | ...[0].resolutionY | X | | X | X | | pixel vertical |
231
+ | | ...[0].currentResX | X | | X | X | | current pixel horizontal |
232
+ | | ...[0].currentResY | X | | X | X | | current pixel vertical |
233
+ | | ...[0].positionX | | | X | X | | display position X |
234
+ | | ...[0].positionY | | | X | X | | display position Y |
235
+ | | ...[0].currentRefreshRate | X | | X | X | | current screen refresh rate |
236
+
237
+ #### 7. Operating System
238
+
239
+ | Function | Result object | Linux | BSD | Mac | Win | Sun | Comments |
240
+ | --------------------- | ------------- | ----- | --- | --- | --- | --- | -------------------------------------------------------------------------------------------------------------------------------------------------- |
241
+ | si.osInfo(cb) | {...} | X | X | X | X | X | OS information |
242
+ | | platform | X | X | X | X | X | 'linux', 'darwin', 'win32', ... |
243
+ | | distro | X | X | X | X | X | |
244
+ | | release | X | X | X | X | X | |
245
+ | | codename | | | X | | | |
246
+ | | kernel | X | X | X | X | X | kernel release - same as os.release() |
247
+ | | arch | X | X | X | X | X | same as os.arch() |
248
+ | | hostname | X | X | X | X | X | same as os.hostname() |
249
+ | | fqdn | X | X | X | X | X | FQDN fully qualified domain name |
250
+ | | codepage | X | X | X | X | | OS build version |
251
+ | | logofile | X | X | X | X | X | e.g. 'apple', 'debian', 'fedora', ... |
252
+ | | serial | X | X | X | X | | OS/Host serial number |
253
+ | | build | X | | X | X | | OS build version |
254
+ | | servicepack | | | | X | | service pack version |
255
+ | | uefi | X | X | X | X | | OS started via UEFI |
256
+ | | hypervisor | | | | X | | hyper-v enabled? (win only) |
257
+ | | remoteSession | | | | X | | runs in remote session (win only) |
258
+ | si.uuid(cb) | {...} | X | X | X | X | X | object of several UUIDs |
259
+ | | os | X | X | X | X | | os specific UUID |
260
+ | | hardware | X | X | X | X | | hardware specific UUID |
261
+ | | macs | X | X | X | X | | MAC addresses |
262
+ | si.versions(apps, cb) | {...} | X | X | X | X | X | version information (kernel, ssl, node, ...)<br />apps param is optional for detecting<br />only specific apps/libs<br />(string, comma separated) |
263
+ | si.shell(cb) | : string | X | X | X | X | | standard shell |
264
+ | si.users(cb) | [{...}] | X | X | X | X | X | array of users online |
265
+ | | [0].user | X | X | X | X | X | user name |
266
+ | | [0].tty | X | X | X | X | X | terminal |
267
+ | | [0].date | X | X | X | X | X | login date |
268
+ | | [0].time | X | X | X | X | X | login time |
269
+ | | [0].ip | X | X | X | | X | ip address (remote login) |
270
+ | | [0].command | X | X | X | | X | last command or shell |
271
+
272
+ #### 8. Current Load, Processes & Services
273
+
274
+ | Function | Result object | Linux | BSD | Mac | Win | Sun | Comments |
275
+ | ------------------------------------ | ----------------- | ----- | --- | --- | --- | --- | --------------------------------------------------------------------------------------- |
276
+ | si.currentLoad(cb) | {...} | X | | X | X | X | CPU-Load |
277
+ | | avgLoad | X | | X | | X | average load |
278
+ | | currentLoad | X | | X | X | X | CPU load in % |
279
+ | | currentLoadUser | X | | X | X | X | CPU load user in % |
280
+ | | currentLoadSystem | X | | X | X | X | CPU load system in % |
281
+ | | currentLoadNice | X | | X | X | X | CPU load nice in % |
282
+ | | currentLoadIdle | X | | X | X | X | CPU load idle in % |
283
+ | | currentLoadIrq | X | | X | X | X | CPU load system in % |
284
+ | | rawCurrentLoad... | X | | X | X | X | CPU load raw values (ticks) |
285
+ | | cpus[] | X | | X | X | X | current loads per CPU in % + raw ticks |
286
+ | si.fullLoad(cb) | : integer | X | | X | X | | CPU full load since bootup in % |
287
+ | si.processes(cb) | {...} | X | X | X | X | X | # running processes |
288
+ | | all | X | X | X | X | X | # of all processes |
289
+ | | running | X | X | X | | X | # of all processes running |
290
+ | | blocked | X | X | X | | X | # of all processes blocked |
291
+ | | sleeping | X | X | X | | X | # of all processes sleeping |
292
+ | | unknown | | | | X | | # of all processes unknown status |
293
+ | | list[] | X | X | X | X | X | list of all processes incl. details |
294
+ | | ...[0].pid | X | X | X | X | X | process PID |
295
+ | | ...[0].parentPid | X | X | X | X | X | parent process PID |
296
+ | | ...[0].name | X | X | X | X | X | process name |
297
+ | | ...[0].cpu | X | X | X | X | X | process % CPU usage |
298
+ | | ...[0].cpuu | X | X | | X | | process % CPU usage (user) |
299
+ | | ...[0].cpus | X | X | | X | | process % CPU usage (system) |
300
+ | | ...[0].mem | X | X | X | X | X | process memory % |
301
+ | | ...[0].priority | X | X | X | X | X | process priority |
302
+ | | ...[0].memVsz | X | X | X | X | X | process virtual memory size |
303
+ | | ...[0].memRss | X | X | X | X | X | process mem resident set size |
304
+ | | ...[0].nice | X | X | X | | X | process nice value |
305
+ | | ...[0].started | X | X | X | X | X | process start time |
306
+ | | ...[0].state | X | X | X | X | X | process state (e.g. sleeping) |
307
+ | | ...[0].tty | X | X | X | | X | tty from which process was started |
308
+ | | ...[0].user | X | X | X | | X | user who started process |
309
+ | | ...[0].command | X | X | X | X | X | process starting command |
310
+ | | ...[0].params | X | X | X | | X | process params |
311
+ | | ...[0].path | X | X | X | X | X | process path |
312
+ | | proc | X | X | X | X | | process name |
313
+ | | pid | X | X | X | X | | PID |
314
+ | | pids | X | X | X | X | | additional pids |
315
+ | | cpu | X | X | X | X | | process % CPU |
316
+ | | mem | X | X | X | X | | process % MEM |
317
+ | si.services('mysql, apache2', cb) | [{...}] | X | X | X | X | | pass comma separated string of services<br>pass "*" for ALL services (linux/win only) |
318
+ | | [0].name | X | X | X | X | | name of service |
319
+ | | [0].running | X | X | X | X | | true / false |
320
+ | | [0].startmode | | | | X | | manual, automatic, ... |
321
+ | | [0].pids | X | X | X | X | | pids |
322
+ | | [0].cpu | X | X | X | | | process % CPU |
323
+ | | [0].mem | X | X | X | | | process % MEM |
324
+ | si.processLoad('mysql, apache2', cb) | [{...}] | X | X | X | X | | pass comma separated string of processes<br>pass "*" for ALL processes (linux/win only) |
325
+ | | [0].proc | X | X | X | X | | name of process |
326
+ | | [0].pids | X | X | X | X | | pids |
327
+ | | [0].cpu | X | X | X | | | process % CPU |
328
+ | | [0].mem | X | X | X | | | process % MEM |
329
+
330
+ #### 9. File System
331
+
332
+ | Function | Result object | Linux | BSD | Mac | Win | Sun | Comments |
333
+ | -------------------- | --------------------- | ----- | --- | --- | --- | --- | ------------------------------------------------------------------------ |
334
+ | si.diskLayout(cb) | [{...}] | X | | X | X | | physical disk layout (array) |
335
+ | | [0].device | X | | X | | | e.g. /dev/sda |
336
+ | | [0].type | X | | X | X | | HD, SSD, NVMe |
337
+ | | [0].name | X | | X | X | | disk name |
338
+ | | [0].vendor | X | | | X | | vendor/producer |
339
+ | | [0].size | X | | X | X | | size in bytes |
340
+ | | [0].bytesPerSector | | | | X | | bytes per sector |
341
+ | | [0].totalCylinders | | | | X | | total cylinders |
342
+ | | [0].totalHeads | | | | X | | total heads |
343
+ | | [0].totalSectors | | | | X | | total sectors |
344
+ | | [0].totalTracks | | | | X | | total tracks |
345
+ | | [0].tracksPerCylinder | | | | X | | tracks per cylinder |
346
+ | | [0].sectorsPerTrack | | | | X | | sectors per track |
347
+ | | [0].firmwareRevision | X | | X | X | | firmware revision |
348
+ | | [0].serialNum | X | | X | X | | serial number |
349
+ | | [0].interfaceType | X | | | X | | SATA, PCIe, ... |
350
+ | | [0].smartStatus | X | | X | X | | S.M.A.R.T Status (see Known Issues) |
351
+ | | [0].temperature | X | | | | | S.M.A.R.T temperature |
352
+ | | [0].smartData | X | | | X | | full S.M.A.R.T data from smartctl<br>requires at least smartmontools 7.0 |
353
+ | si.blockDevices(cb) | [{...}] | X | | X | X | | returns array of disks, partitions,<br>raids and roms |
354
+ | | [0].name | X | | X | X | | name |
355
+ | | [0].type | X | | X | X | | type |
356
+ | | [0].fstype | X | | X | X | | file system type (e.g. ext4) |
357
+ | | [0].mount | X | | X | X | | mount point |
358
+ | | [0].size | X | | X | X | | size in bytes |
359
+ | | [0].physical | X | | X | X | | physical type (HDD, SSD, CD/DVD) |
360
+ | | [0].uuid | X | | X | X | | UUID |
361
+ | | [0].label | X | | X | X | | label |
362
+ | | [0].model | X | | X | | | model |
363
+ | | [0].serial | X | | | X | | serial |
364
+ | | [0].removable | X | | X | X | | serial |
365
+ | | [0].protocol | X | | X | | | protocol (SATA, PCI-Express, ...) |
366
+ | | [0].group | X | | | | | Raid group member (e.g. md1) |
367
+ | | [0].device | X | | X | X | | physical device mapped to (e.g. /dev/sda) |
368
+ | si.disksIO(cb) | {...} | X | | X | | | current transfer stats |
369
+ | | rIO | X | | X | | | read IOs on all mounted drives |
370
+ | | wIO | X | | X | | | write IOs on all mounted drives |
371
+ | | tIO | X | | X | | | write IOs on all mounted drives |
372
+ | | rIO_sec | X | | X | | | read IO per sec (* see notes) |
373
+ | | wIO_sec | X | | X | | | write IO per sec (* see notes) |
374
+ | | tIO_sec | X | | X | | | total IO per sec (* see notes) |
375
+ | | rWaitTime | X | | | | | read IO request time (* see notes) |
376
+ | | wWaitTime | X | | | | | write IO request time (* see notes) |
377
+ | | tWaitTime | X | | | | | total IO request time (* see notes) |
378
+ | | rWaitPercent | X | | | | | read IO request time percent (* see notes) |
379
+ | | wWaitPercent | X | | | | | write IO request time percent (* see notes) |
380
+ | | tWaitPercent | X | | | | | total IO request time percent (* see notes) |
381
+ | | ms | X | | X | | | interval length (for per second values) |
382
+ | si.fsSize(drive, cb) | [{...}] | X | X | X | X | | returns array of mounted file systems<br>drive param is optional |
383
+ | | [0].fs | X | X | X | X | | name of file system |
384
+ | | [0].type | X | X | X | X | | type of file system |
385
+ | | [0].size | X | X | X | X | | sizes in bytes |
386
+ | | [0].used | X | X | X | X | | used in bytes |
387
+ | | [0].available | X | X | X | X | | used in bytes |
388
+ | | [0].use | X | X | X | X | | used in % |
389
+ | | [0].mount | X | X | X | X | | mount point |
390
+ | | [0].rw | X | X | X | X | | read and write (false if read only) |
391
+ | si.fsOpenFiles(cb) | {...} | X | X | X | | | count max/allocated file descriptors |
392
+ | | max | X | X | X | | | max file descriptors |
393
+ | | allocated | X | X | X | | | current open files count |
394
+ | | available | X | X | X | | | count available |
395
+ | si.fsStats(cb) | {...} | X | | X | | | current transfer stats |
396
+ | | rx | X | | X | | | bytes read since startup |
397
+ | | wx | X | | X | | | bytes written since startup |
398
+ | | tx | X | | X | | | total bytes read + written since startup |
399
+ | | rx_sec | X | | X | | | bytes read / second (* see notes) |
400
+ | | wx_sec | X | | X | | | bytes written / second (* see notes) |
401
+ | | tx_sec | X | | X | | | total bytes reads + written / second |
402
+ | | ms | X | | X | | | interval length (for per second values) |
403
+
404
+ #### 10. USB
405
+
406
+ | Function | Result object | Linux | BSD | Mac | Win | Sun | Comments |
407
+ | ---------- | ---------------- | ----- | --- | --- | --- | --- | ------------------------ |
408
+ | si.usb(cb) | [{...}] | X | X | X | X | | get detected USB devices |
409
+ | | [0].bus | X | | | | | USB bus |
410
+ | | [0].deviceId | X | | | | | bus device id |
411
+ | | [0].id | X | | X | X | | internal id |
412
+ | | [0].name | X | | X | X | | name |
413
+ | | [0].type | X | | X | X | | name |
414
+ | | [0].removable | | | X | | | is removable |
415
+ | | [0].vendor | X | | X | | | vendor |
416
+ | | [0].manufacturer | X | | X | X | | manufacturer |
417
+ | | [0].maxPower | X | | | | | max power |
418
+ | | [0].default | X | | X | X | | is default printer |
419
+ | | [0].serialNumber | | | X | | | serial number |
420
+
421
+ #### 11. Printer
422
+
423
+ | Function | Result object | Linux | BSD | Mac | Win | Sun | Comments |
424
+ | -------------- | ------------- | ----- | --- | --- | --- | --- | -------------------------- |
425
+ | si.printer(cb) | [{...}] | X | X | X | X | | get printer information |
426
+ | | [0].id | X | | X | X | | internal id |
427
+ | | [0].name | X | | X | X | | name |
428
+ | | [0].model | X | | X | X | | model |
429
+ | | [0].uri | X | | X | | | printer URI |
430
+ | | [0].uuid | X | | | | | printer UUID |
431
+ | | [0].status | X | | X | X | | printer status (e.g. idle) |
432
+ | | [0].local | X | | X | X | | is local printer |
433
+ | | [0].default | | | X | X | | is default printer |
434
+ | | [0].shared | X | | X | X | | is shared printer |
435
+
436
+ #### 12. Audio
437
+
438
+ | Function | Result object | Linux | BSD | Mac | Win | Sun | Comments |
439
+ | ------------ | ----------------- | ----- | --- | --- | --- | --- | ------------------------------------- |
440
+ | si.audio(cb) | [{...}] | X | X | X | X | | get printer information |
441
+ | | [0].id | X | | X | X | | internal id |
442
+ | | [0].name | X | | X | X | | name |
443
+ | | [0].manufacturer | X | | X | X | | manufacturer |
444
+ | | [0].revision | X | | | | | revision |
445
+ | | [0].driver | X | | | | | driver |
446
+ | | [0].default | | | X | X | | is default |
447
+ | | [0].channel | X | | X | | | channel e.g. USB, HDMI, ... |
448
+ | | [0].type | X | | X | X | | type e.g. Speaker |
449
+ | | [0].in | | | X | X | | is input channel |
450
+ | | [0].out | | | X | X | | is output channel |
451
+ | | [0].interfaceType | X | | X | X | | interface type (PCIe, USB, HDMI, ...) |
452
+ | | [0].status | X | | X | X | | printer status (e.g. idle) |
453
+
454
+ #### 13. Network related functions
455
+
456
+ | Function | Result object | Linux | BSD | Mac | Win | Sun | Comments |
457
+ | ------------------------------ | ------------------ | ----- | --- | --- | --- | --- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
458
+ | si.networkInterfaces(cb) | [{...}] | X | X | X | X | X | array of network interfaces<br>With the 'default' parameter it returns<br>only the default interface |
459
+ | | [0].iface | X | X | X | X | X | interface |
460
+ | | [0].ifaceName | X | X | X | X | X | interface name (differs on Windows) |
461
+ | | [0].default | X | X | X | X | X | true if this is the default interface |
462
+ | | [0].ip4 | X | X | X | X | X | ip4 address |
463
+ | | [0].ip4subnet | X | X | X | X | X | ip4 subnet mask |
464
+ | | [0].ip6 | X | X | X | X | X | ip6 address |
465
+ | | [0].ip6subnet | X | X | X | X | X | ip6 subnet mask |
466
+ | | [0].mac | X | X | X | X | X | MAC address |
467
+ | | [0].internal | X | X | X | X | X | true if internal interface |
468
+ | | [0].virtual | X | X | X | X | X | true if virtual interface |
469
+ | | [0].operstate | X | | X | X | | up / down |
470
+ | | [0].type | X | | X | X | | wireless / wired |
471
+ | | [0].duplex | X | | X | | | duplex |
472
+ | | [0].mtu | X | | X | | | maximum transmission unit |
473
+ | | [0].speed | X | | X | X | | speed in MBit / s |
474
+ | | [0].dhcp | X | | X | X | | IP address obtained by DHCP |
475
+ | | [0].dnsSuffix | X | | | X | | DNS suffix |
476
+ | | [0].ieee8021xAuth | X | | | X | | IEEE 802.1x auth |
477
+ | | [0].ieee8021xState | X | | | X | | IEEE 802.1x state |
478
+ | | [0].carrierChanges | X | | | | | # changes up/down |
479
+ | si.networkInterfaceDefault(cb) | : string | X | X | X | X | X | get name of default network interface |
480
+ | si.networkGatewayDefault(cb) | : string | X | X | X | X | X | get default network gateway |
481
+ | si.networkStats(ifaces,cb) | [{...}] | X | X | X | X | | current network stats of given interfaces<br>iface list: space or comma separated<br>iface parameter is optional<br>defaults to first external network interface,<br />Pass '*' for all interfaces |
482
+ | | [0].iface | X | X | X | X | | interface |
483
+ | | [0].operstate | X | X | X | X | | up / down |
484
+ | | [0].rx_bytes | X | X | X | X | | received bytes overall |
485
+ | | [0].rx_dropped | X | X | X | X | | received dropped overall |
486
+ | | [0].rx_errors | X | X | X | X | | received errors overall |
487
+ | | [0].tx_bytes | X | X | X | X | | transferred bytes overall |
488
+ | | [0].tx_dropped | X | X | X | X | | transferred dropped overall |
489
+ | | [0].tx_errors | X | X | X | X | | transferred errors overall |
490
+ | | [0].rx_sec | X | X | X | X | | received bytes / second (* see notes) |
491
+ | | [0].tx_sec | X | X | X | X | | transferred bytes per second (* see notes) |
492
+ | | [0].ms | X | X | X | X | | interval length (for per second values) |
493
+ | si.networkConnections(cb) | [{...}] | X | X | X | X | | current network network connections<br>returns an array of all connections |
494
+ | | [0].protocol | X | X | X | X | | tcp or udp |
495
+ | | [0].localAddress | X | X | X | X | | local address |
496
+ | | [0].localPort | X | X | X | X | | local port |
497
+ | | [0].peerAddress | X | X | X | X | | peer address |
498
+ | | [0].peerPort | X | X | X | X | | peer port |
499
+ | | [0].state | X | X | X | X | | like ESTABLISHED, TIME_WAIT, ... |
500
+ | | [0].pid | X | X | X | X | | process ID |
501
+ | | [0].process | X | X | X | | | process name |
502
+ | si.inetChecksite(url, cb) | {...} | X | X | X | X | X | response-time (ms) to fetch given URL |
503
+ | | url | X | X | X | X | X | given url |
504
+ | | ok | X | X | X | X | X | status code OK (2xx, 3xx) |
505
+ | | status | X | X | X | X | X | status code |
506
+ | | ms | X | X | X | X | X | response time in ms |
507
+ | si.inetLatency(host, cb) | : number | X | X | X | X | X | response-time (ms) to external resource<br>host parameter is optional (default 8.8.8.8) |
508
+
509
+ #### 14. Wifi
510
+
511
+ | Function | Result object | Linux | BSD | Mac | Win | Sun | Comments |
512
+ | ---------------------- | --------------- | ----- | --- | --- | --- | --- | --------------------------------- |
513
+ | si.wifiNetworks(cb) | [{...}] | X | | X | X | | array of available wifi networks |
514
+ | | [0].ssid | X | | X | X | | Wifi network SSID |
515
+ | | [0].bssid | X | | X | X | | BSSID (mac) |
516
+ | | [0].mode | X | | | | | mode |
517
+ | | [0].channel | X | | X | X | | channel |
518
+ | | [0].frequency | X | | X | X | | frequency in MHz |
519
+ | | [0].signalLevel | X | | X | X | | signal level in dB |
520
+ | | [0].quality | X | | X | X | | quality in % |
521
+ | | [0].security | X | | X | X | | array e.g. WPA, WPA-2 |
522
+ | | [0].wpaFlags | X | | X | X | | array of WPA flags |
523
+ | | [0].rsnFlags | X | | | | | array of RDN flags |
524
+ | si.wifiInterfaces(cb) | [{...}] | X | | X | X | | array of detected wifi interfaces |
525
+ | | [0].id | X | | X | X | | ID |
526
+ | | [0].iface | X | | X | X | | interface |
527
+ | | [0].model | X | | X | X | | model |
528
+ | | [0].vendor | X | | X | X | | vendor |
529
+ | | [0].mac | X | | X | X | | MAC address |
530
+ | si.wifiConnections(cb) | [{...}] | X | | X | X | | array of active wifi connections |
531
+ | | [0].id | X | | X | X | | ID |
532
+ | | [0].iface | X | | X | X | | interface |
533
+ | | [0].name | X | | X | X | | name |
534
+ | | [0].mode | X | | X | X | | model |
535
+ | | [0].bssid | X | | X | X | | BSSID (mac) |
536
+ | | [0].mode | X | | | | | mode |
537
+ | | [0].channel | X | | X | X | | channel |
538
+ | | [0].frequency | X | | X | X | | frequency in MHz |
539
+ | | [0].signalLevel | X | | X | X | | signal level in dB |
540
+ | | [0].quality | X | | X | X | | quality in % |
541
+ | | [0].security | X | | X | X | | array e.g. WPA, WPA-2 |
542
+ | | [0].txRate | X | | X | X | | transfer rate MBit/s |
543
+
544
+ #### 15. Bluetooth
545
+
546
+ | Function | Result object | Linux | BSD | Mac | Win | Sun | Comments |
547
+ | ----------------------- | ------------------ | ----- | --- | --- | --- | --- | ------------------------ |
548
+ | si.bluetoothDevices(cb) | [{...}] | X | | X | X | | ... |
549
+ | | [0].device | | | X | | | device name |
550
+ | | [0].name | X | | X | X | | name |
551
+ | | [0].macDevice | X | | X | | | MAC address device |
552
+ | | [0].macHost | X | | X | | | MAC address host |
553
+ | | [0].batteryPercent | | | X | | | battery level percent |
554
+ | | [0].manufacturer | | | X | X | | manufacturer |
555
+ | | [0].type | X | | X | X | | type of bluetooth device |
556
+ | | [0].connected | X | | X | | | is connected |
557
+
558
+ #### 16. Docker
559
+
560
+ | Function | Result object | Linux | BSD | Mac | Win | Sun | Comments |
561
+ | ----------------------------------- | ------------------- | ----------------------------------- | --- | --- | --- | --- | ------------------------------------------------------------------------------------------------------------- |
562
+ | si.dockerInfo(cb) | {...} | X | X | X | X | X | returns general docker info |
563
+ | | id | X | X | X | X | X | Docker ID |
564
+ | | containers | X | X | X | X | X | number of containers |
565
+ | | containersRunning | X | X | X | X | X | number of running containers |
566
+ | | containersPaused | X | X | X | X | X | number of paused containers |
567
+ | | containersStopped | X | X | X | X | X | number of stopped containers |
568
+ | | images | X | X | X | X | X | number of images |
569
+ | | driver | X | X | X | X | X | driver (e.g. 'devicemapper', 'overlay2') |
570
+ | | memoryLimit | X | X | X | X | X | has memory limit |
571
+ | | swapLimit | X | X | X | X | X | has swap limit |
572
+ | | kernelMemory | X | X | X | X | X | has kernel memory |
573
+ | | cpuCfsPeriod | X | X | X | X | X | has CpuCfsPeriod |
574
+ | | cpuCfsQuota | X | X | X | X | X | has CpuCfsQuota |
575
+ | | cpuShares | X | X | X | X | X | has CPUShares |
576
+ | | cpuSet | X | X | X | X | X | has CPUShares |
577
+ | | ipv4Forwarding | X | X | X | X | X | has IPv4Forwarding |
578
+ | | bridgeNfIptables | X | X | X | X | X | has BridgeNfIptables |
579
+ | | bridgeNfIp6tables | X | X | X | X | X | has BridgeNfIp6tables |
580
+ | | debug | X | X | X | X | X | Debug on |
581
+ | | nfd | X | X | X | X | X | named data networking forwarding daemon |
582
+ | | oomKillDisable | X | X | X | X | X | out-of-memory kill disabled |
583
+ | | ngoroutines | X | X | X | X | X | number NGoroutines |
584
+ | | systemTime | X | X | X | X | X | docker SystemTime |
585
+ | | loggingDriver | X | X | X | X | X | logging driver e.g. 'json-file' |
586
+ | | cgroupDriver | X | X | X | X | X | cgroup driver e.g. 'cgroupfs' |
587
+ | | nEventsListener | X | X | X | X | X | number NEventsListeners |
588
+ | | kernelVersion | X | X | X | X | X | docker kernel version |
589
+ | | operatingSystem | X | X | X | X | X | docker OS e.g. 'Docker for Mac' |
590
+ | | osType | X | X | X | X | X | OSType e.g. 'linux' |
591
+ | | architecture | X | X | X | X | X | architecture e.g. x86_64 |
592
+ | | ncpu | X | X | X | X | X | number of CPUs |
593
+ | | memTotal | X | X | X | X | X | memory total |
594
+ | | dockerRootDir | X | X | X | X | X | docker root directory |
595
+ | | httpProxy | X | X | X | X | X | http proxy |
596
+ | | httpsProxy | X | X | X | X | X | https proxy |
597
+ | | noProxy | X | X | X | X | X | NoProxy |
598
+ | | name | X | X | X | X | X | Name |
599
+ | | labels | X | X | X | X | X | array of labels |
600
+ | | experimentalBuild | X | X | X | X | X | is experimental build |
601
+ | | serverVersion | X | X | X | X | X | server version |
602
+ | | clusterStore | X | X | X | X | X | cluster store |
603
+ | | clusterAdvertise | X | X | X | X | X | cluster advertise |
604
+ | | defaultRuntime | X | X | X | X | X | default runtime e.g. 'runc' |
605
+ | | liveRestoreEnabled | X | X | X | X | X | live store enabled |
606
+ | | isolation | X | X | X | X | X | isolation |
607
+ | | initBinary | X | X | X | X | X | init binary |
608
+ | | productLicense | X | X | X | X | X | product license |
609
+ | si.dockerImages(all, cb) | [{...}] | X | X | X | X | X | returns array of top level/all docker images |
610
+ | | [0].id | X | X | X | X | X | image ID |
611
+ | | [0].container | X | X | X | X | X | container ID |
612
+ | | [0].comment | X | X | X | X | X | comment |
613
+ | | [0].os | X | X | X | X | X | OS |
614
+ | | [0].architecture | X | X | X | X | X | architecture |
615
+ | | [0].parent | X | X | X | X | X | parent ID |
616
+ | | [0].dockerVersion | X | X | X | X | X | docker version |
617
+ | | [0].size | X | X | X | X | X | image size |
618
+ | | [0].sharedSize | X | X | X | X | X | shared size |
619
+ | | [0].virtualSize | X | X | X | X | X | virtual size |
620
+ | | [0].author | X | X | X | X | X | author |
621
+ | | [0].created | X | X | X | X | X | created date / time |
622
+ | | [0].containerConfig | X | X | X | X | X | container config object |
623
+ | | [0].graphDriver | X | X | X | X | X | graph driver object |
624
+ | | [0].repoDigests | X | X | X | X | X | repo digests array |
625
+ | | [0].repoTags | X | X | X | X | X | repo tags array |
626
+ | | [0].config | X | X | X | X | X | config object |
627
+ | | [0].rootFS | X | X | X | X | X | root fs object |
628
+ | si.dockerContainers(all, cb) | [{...}] | X | X | X | X | X | returns array of active/all docker containers |
629
+ | | [0].id | X | X | X | X | X | ID of container |
630
+ | | [0].name | X | X | X | X | X | name of container |
631
+ | | [0].image | X | X | X | X | X | name of image |
632
+ | | [0].imageID | X | X | X | X | X | ID of image |
633
+ | | [0].command | X | X | X | X | X | command |
634
+ | | [0].created | X | X | X | X | X | creation time (unix) |
635
+ | | [0].started | X | X | X | X | X | creation time (unix) |
636
+ | | [0].finished | X | X | X | X | X | creation time (unix) |
637
+ | | [0].createdAt | X | X | X | X | X | creation date time string |
638
+ | | [0].startedAt | X | X | X | X | X | creation date time string |
639
+ | | [0].finishedAt | X | X | X | X | X | creation date time string |
640
+ | | [0].state | X | X | X | X | X | created, running, exited |
641
+ | | [0].ports | X | X | X | X | X | array of ports |
642
+ | | [0].mounts | X | X | X | X | X | array of mounts |
643
+ | si.dockerContainerStats(ids, cb) | [{...}] | X | X | X | X | X | statistics for specific containers<br>container IDs: space or comma separated,<br>pass '*' for all containers |
644
+ | | [0].id | X | X | X | X | X | Container ID |
645
+ | | [0].memUsage | X | X | X | X | X | memory usage in bytes |
646
+ | | [0].memLimit | X | X | X | X | X | memory limit (max mem) in bytes |
647
+ | | [0].memPercent | X | X | X | X | X | memory usage in percent |
648
+ | | [0].cpuPercent | X | X | X | X | X | cpu usage in percent |
649
+ | | [0].pids | X | X | X | X | X | number of processes |
650
+ | | [0].netIO.rx | X | X | X | X | X | received bytes via network |
651
+ | | [0].netIO.wx | X | X | X | X | X | sent bytes via network |
652
+ | | [0].blockIO.r | X | X | X | X | X | bytes read from BlockIO |
653
+ | | [0].blockIO.w | X | X | X | X | X | bytes written to BlockIO |
654
+ | | [0].cpuStats | X | X | X | X | X | detailed cpu stats |
655
+ | | [0].percpuStats | X | X | X | X | X | detailed per cpu stats |
656
+ | | [0].memoryStats | X | X | X | X | X | detailed memory stats |
657
+ | | [0].networks | X | X | X | X | X | detailed network stats per interface |
658
+ | si.dockerContainerProcesses(id, cb) | [{...}] | X | X | X | X | X | array of processes inside a container |
659
+ | | [0].pidHost | X | X | X | X | X | process ID (host) |
660
+ | | [0].ppid | X | X | X | X | X | parent process ID |
661
+ | | [0].pgid | X | X | X | X | X | process group ID |
662
+ | | [0].user | X | X | X | X | X | effective user name |
663
+ | | [0].ruser | X | X | X | X | X | real user name |
664
+ | | [0].group | X | X | X | X | X | effective group name |
665
+ | | [0].rgroup | X | X | X | X | X | real group name |
666
+ | | [0].stat | X | X | X | X | X | process state |
667
+ | | [0].time | X | X | X | X | X | accumulated CPU time |
668
+ | | [0].elapsed | X | X | X | X | X | elapsed running time |
669
+ | | [0].nice | X | X | X | X | X | nice value |
670
+ | | [0].rss | X | X | X | X | X | resident set size |
671
+ | | [0].vsz | X | X | X | X | X | virtual size in Kbytes |
672
+ | | [0].command | X | X | X | X | X | command and arguments |
673
+ | si.dockerVolumes(cb) | [{...}] | returns array of all docker volumes |
674
+ | | [0].name | X | X | X | X | X | volume name |
675
+ | | [0].driver | X | X | X | X | X | driver |
676
+ | | [0].labels | X | X | X | X | X | labels object |
677
+ | | [0].mountpoint | X | X | X | X | X | mountpoint |
678
+ | | [0].options | X | X | X | X | X | options |
679
+ | | [0].scope | X | X | X | X | X | scope |
680
+ | | [0].created | X | X | X | X | X | created at |
681
+ | si.dockerAll(cb) | {...} | X | X | X | X | X | list of all containers including their stats<br>and processes in one single array |
682
+
683
+ #### 17. Virtual Box
684
+
685
+ | Function | Result object | Linux | BSD | Mac | Win | Sun | Comments |
686
+ | --------------- | -------------------- | ----- | --- | --- | --- | --- | -------------------------------------- |
687
+ | si.vboxInfo(cb) | [{...}] | X | X | X | X | X | returns array general virtual box info |
688
+ | | [0].id | X | X | X | X | X | virtual box ID |
689
+ | | [0].name | X | X | X | X | X | name |
690
+ | | [0].running | X | X | X | X | X | vbox is running |
691
+ | | [0].started | X | X | X | X | X | started date time |
692
+ | | [0].runningSince | X | X | X | X | X | running since (secs) |
693
+ | | [0].stopped | X | X | X | X | X | stopped date time |
694
+ | | [0].stoppedSince | X | X | X | X | X | stopped since (secs) |
695
+ | | [0].guestOS | X | X | X | X | X | Guest OS |
696
+ | | [0].hardwareUUID | X | X | X | X | X | Hardware UUID |
697
+ | | [0].memory | X | X | X | X | X | Memory in MB |
698
+ | | [0].vram | X | X | X | X | X | VRAM in MB |
699
+ | | [0].cpus | X | X | X | X | X | CPUs |
700
+ | | [0].cpuExepCap | X | X | X | X | X | CPU exec cap |
701
+ | | [0].cpuProfile | X | X | X | X | X | CPU profile |
702
+ | | [0].chipset | X | X | X | X | X | chipset |
703
+ | | [0].firmware | X | X | X | X | X | firmware |
704
+ | | [0].pageFusion | X | X | X | X | X | page fusion |
705
+ | | [0].configFile | X | X | X | X | X | config file |
706
+ | | [0].snapshotFolder | X | X | X | X | X | snapshot folder |
707
+ | | [0].logFolder | X | X | X | X | X | log folder path |
708
+ | | [0].hpet | X | X | X | X | X | HPET |
709
+ | | [0].pae | X | X | X | X | X | PAE |
710
+ | | [0].longMode | X | X | X | X | X | long mode |
711
+ | | [0].tripleFaultReset | X | X | X | X | X | triple fault reset |
712
+ | | [0].apic | X | X | X | X | X | APIC |
713
+ | | [0].x2Apic | X | X | X | X | X | X2APIC |
714
+ | | [0].acpi | X | X | X | X | X | ACPI |
715
+ | | [0].ioApic | X | X | X | X | X | IOAPIC |
716
+ | | [0].biosApicMode | X | X | X | X | X | BIOS APIC mode |
717
+ | | [0].bootMenuMode | X | X | X | X | X | boot menu Mode |
718
+ | | [0].bootDevice1 | X | X | X | X | X | bootDevice1 |
719
+ | | [0].bootDevice2 | X | X | X | X | X | bootDevice2 |
720
+ | | [0].bootDevice3 | X | X | X | X | X | bootDevice3 |
721
+ | | [0].bootDevice4 | X | X | X | X | X | bootDevice4 |
722
+ | | [0].timeOffset | X | X | X | X | X | time Offset |
723
+ | | [0].rtc | X | X | X | X | X | RTC |
724
+
725
+ #### 16. "Get All / Observe" - functions
726
+
727
+ | Function | Result object | Linux | BSD | Mac | Win | Sun | Comments |
728
+ | ----------------------------------- | ------------- | ----- | --- | --- | --- | --- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
729
+ | si.getStaticData(cb) | {...} | X | X | X | X | X | all static data at once |
730
+ | si.getDynamicData(srv,iface,cb) | {...} | X | X | X | X | X | all dynamic data at once<br>Specify services and interfaces to monitor<br>Defaults to first external network interface<br>Pass "*" for ALL services (linux/win only)<br>Pass "*" for ALL network interfaces |
731
+ | si.getAllData(srv,iface,cb) | {...} | X | X | X | X | X | all data at once<br>Specify services and interfaces to monitor<br>Defaults to first external network interface<br>Pass "*" for ALL services (linux/win only)<br>Pass "*" for ALL network interfaces |
732
+ | si.get(valueObject,cb) | {...} | X | X | X | X | X | get partial system info data at once<br>In valueObject you can define<br>all values, you want to get back <br>(see documentation for details) |
733
+ | si.observe(valueObject,interval,cb) | - | X | X | X | X | X | Observe a defined value object<br>call callback on changes<br>polling interval in milliseconds |
734
+
735
+ ### cb: Asynchronous Function Calls (callback)
736
+
737
+ Remember: all functions (except `version` and `time`) are implemented as asynchronous functions! There are now three ways to consume them:
738
+
739
+ **Callback Style**
740
+
741
+ ```js
742
+ const si = require('systeminformation');
743
+
744
+ si.cpu(function(data) {
745
+ console.log('CPU Information:');
746
+ console.log('- manufacturer: ' + data.manufacturer);
747
+ console.log('- brand: ' + data.brand);
748
+ console.log('- speed: ' + data.speed);
749
+ console.log('- cores: ' + data.cores);
750
+ console.log('- physical cores: ' + data.physicalCores);
751
+ console.log('...');
752
+ })
753
+ ```
754
+
755
+ ### Promises
756
+
757
+ **Promises Style** is new in version 3.0.
758
+
759
+ 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:
760
+
761
+ ```js
762
+ const si = require('systeminformation');
763
+
764
+ si.cpu()
765
+ .then(data => {
766
+ console.log('CPU Information:');
767
+ console.log('- manufacturer: ' + data.manufacturer);
768
+ console.log('- brand: ' + data.brand);
769
+ console.log('- speed: ' + data.speed);
770
+ console.log('- cores: ' + data.cores);
771
+ console.log('- physical cores: ' + data.physicalCores);
772
+ console.log('...');
773
+ })
774
+ .catch(error => console.error(error));
775
+ ```
776
+
777
+ ### Async / Await
778
+
779
+ **Using async / await** (available since node v7.6)
780
+
781
+ Since node v7.6 you can also use the `async` / `await` pattern. The above example would then look like this:
782
+
783
+ ```js
784
+ const si = require('systeminformation');
785
+
786
+ async function cpuData() {
787
+ try {
788
+ const data = await si.cpu();
789
+ console.log('CPU Information:');
790
+ console.log('- manufacturer: ' + data.manufacturer);
791
+ console.log('- brand: ' + data.brand);
792
+ console.log('- speed: ' + data.speed);
793
+ console.log('- cores: ' + data.cores);
794
+ console.log('- physical cores: ' + data.physicalCores);
795
+ console.log('...');
796
+ } catch (e) {
797
+ console.log(e)
798
+ }
799
+ }
800
+ ```
801
+
802
+ ## Known Issues
803
+
804
+ #### macOS - Temperature Sensor
805
+
806
+ To be able to measure temperature on macOS I created a little additional package. Due to some difficulties
807
+ in NPM with `optionalDependencies` I unfortunately was getting unexpected warnings on other platforms.
808
+ So I decided to drop this optional dependency for macOS - so by default, you will not get correct values.
809
+
810
+ This additional package is now also supporting Apple Silicon M1 machines.
811
+
812
+ But if you need to detect macOS temperature just run the following additional
813
+ installation command:
814
+
815
+ ```bash
816
+ $ npm install osx-temperature-sensor --save
817
+ ```
818
+
819
+ `systeminformation` will then detect this additional library and return the temperature when calling systeminformations standard function `cpuTemperature()`
820
+
821
+ #### Windows Temperature, Battery, ...
822
+
823
+ `get-WmiObject` - which is used to determine temperature and battery sometimes needs to be run with admin
824
+ privileges. So if you do not get any values, try to run it again with according
825
+ privileges. If you still do not get any values, your system might not support this feature.
826
+ In some cases we also discovered that `get-WmiObject` returned incorrect temperature values.
827
+
828
+ #### Linux Temperature
829
+
830
+ In some cases you need to install the Linux `sensors` package to be able to measure temperature
831
+ e.g. on DEBIAN based systems by running `sudo apt-get install lm-sensors`
832
+
833
+ #### Linux S.M.A.R.T. Status
834
+
835
+ 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`
836
+
837
+ #### Windows Encoding Issues
838
+ 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.
839
+ ## *: Additional Notes
840
+
841
+ In `fsStats()`, `disksIO()` and `networkStats()` the results / sec. values (rx_sec, IOPS, ...) are calculated correctly beginning
842
+ with the second call of the function. It is determined by calculating the difference of transferred bytes / IOs
843
+ divided by the time between two calls of the function.
844
+
845
+ 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 ...
846
+
847
+ So basically, if you e.g. need a value for network stats every second, your code should look like this:
848
+
849
+ ```js
850
+ const si = require('sysiddr5');
851
+
852
+ setInterval(function() {
853
+ si.networkStats().then(data => {
854
+ console.log(data);
855
+ })
856
+ }, 1000)
857
+ ```
858
+
859
+ ## Credits
860
+
861
+ Written by Sebastian Hildebrandt [sebhildebrandt](https://github.com/sebhildebrandt) & thororen
862
+
863
+ ## License [![MIT license][license-img]][license-url]
864
+
865
+ >The [`MIT`][license-url] License (MIT)
866
+ >
867
+ >Copyright &copy; 2014-2023 Sebastian Hildebrandt, [+innovations](http://www.plus-innovations.com).
868
+ >
869
+ >Permission is hereby granted, free of charge, to any person obtaining a copy
870
+ >of this software and associated documentation files (the "Software"), to deal
871
+ >in the Software without restriction, including without limitation the rights
872
+ >to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
873
+ >copies of the Software, and to permit persons to whom the Software is
874
+ >furnished to do so, subject to the following conditions:
875
+ >
876
+ >The above copyright notice and this permission notice shall be included in
877
+ >all copies or substantial portions of the Software.
878
+ >
879
+ >THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
880
+ >IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
881
+ >FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
882
+ >AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
883
+ >LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
884
+ >OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
885
+ >THE SOFTWARE.