systeminformation 5.33.5 → 6.0.0-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +873 -958
- package/dist/audio.d.ts +1 -0
- package/dist/audio.js +18 -0
- package/dist/baseboard.d.ts +1 -0
- package/dist/baseboard.js +17 -0
- package/dist/battery.d.ts +1 -0
- package/dist/battery.js +19 -0
- package/dist/bios.d.ts +1 -0
- package/dist/bios.js +17 -0
- package/dist/block-devices.d.ts +1 -0
- package/dist/block-devices.js +17 -0
- package/dist/bluetooth.d.ts +1 -0
- package/dist/bluetooth.js +17 -0
- package/dist/bsd/battery.d.ts +2 -0
- package/dist/bsd/battery.js +27 -0
- package/dist/bsd/cpu-cache.d.ts +1 -0
- package/dist/bsd/cpu-cache.js +37 -0
- package/dist/bsd/cpu-flags.d.ts +1 -0
- package/dist/bsd/cpu-flags.js +28 -0
- package/dist/bsd/cpu-temperature.d.ts +1 -0
- package/dist/bsd/cpu-temperature.js +29 -0
- package/dist/bsd/cpu.d.ts +1 -0
- package/dist/bsd/cpu.js +98 -0
- package/dist/bsd/index.d.ts +38 -0
- package/dist/bsd/index.js +85 -0
- package/dist/bsd/mem.d.ts +1 -0
- package/dist/bsd/mem.js +37 -0
- package/dist/bsd/network-stats.d.ts +2 -0
- package/dist/bsd/network-stats.js +92 -0
- package/dist/bsd/os-info.d.ts +24 -0
- package/dist/bsd/os-info.js +47 -0
- package/dist/bsd/uuid.d.ts +2 -0
- package/dist/bsd/uuid.js +30 -0
- package/dist/camera.d.ts +1 -0
- package/dist/camera.js +17 -0
- package/dist/chassis.d.ts +1 -0
- package/dist/chassis.js +17 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +107 -0
- package/dist/common/acceleration.d.ts +8 -0
- package/dist/common/acceleration.js +86 -0
- package/dist/common/codepage.d.ts +1 -0
- package/dist/common/codepage.js +43 -0
- package/dist/common/const.d.ts +25 -0
- package/dist/common/const.js +26 -0
- package/dist/common/cpu.d.ts +2 -0
- package/dist/common/cpu.js +12 -0
- package/dist/common/darwin.d.ts +6 -0
- package/dist/common/darwin.js +266 -0
- package/dist/common/datetime.d.ts +9 -0
- package/dist/common/datetime.js +161 -0
- package/dist/common/defaults.d.ts +25 -0
- package/dist/common/defaults.js +304 -0
- package/dist/common/exec.d.ts +10 -0
- package/dist/common/exec.js +69 -0
- package/dist/common/files.d.ts +2 -0
- package/dist/common/files.js +39 -0
- package/dist/common/filesys.d.ts +11 -0
- package/dist/common/filesys.js +282 -0
- package/dist/common/host.d.ts +2 -0
- package/dist/common/host.js +67 -0
- package/dist/common/index.d.ts +12 -0
- package/dist/common/index.js +146 -0
- package/dist/common/internet.d.ts +6 -0
- package/dist/common/internet.js +92 -0
- package/dist/common/mappings.d.ts +55 -0
- package/dist/common/mappings.js +4133 -0
- package/dist/common/network.d.ts +8 -0
- package/dist/common/network.js +162 -0
- package/dist/common/nvidia.d.ts +22 -0
- package/dist/common/nvidia.js +159 -0
- package/dist/common/parse.d.ts +13 -0
- package/dist/common/parse.js +157 -0
- package/dist/common/raspberry.d.ts +5 -0
- package/dist/common/raspberry.js +277 -0
- package/dist/common/security.d.ts +31 -0
- package/dist/common/security.js +241 -0
- package/dist/common/types.d.ts +1024 -0
- package/dist/common/types.js +2 -0
- package/dist/common/windows.d.ts +58 -0
- package/dist/common/windows.js +292 -0
- package/dist/cpu-cache.d.ts +1 -0
- package/dist/cpu-cache.js +19 -0
- package/dist/cpu-current-load.d.ts +2 -0
- package/dist/cpu-current-load.js +249 -0
- package/dist/cpu-current-speed.d.ts +3 -0
- package/dist/cpu-current-speed.js +84 -0
- package/dist/cpu-flags.d.ts +1 -0
- package/dist/cpu-flags.js +19 -0
- package/dist/cpu-full-load.d.ts +1 -0
- package/dist/cpu-full-load.js +30 -0
- package/dist/cpu-temperature.d.ts +1 -0
- package/dist/cpu-temperature.js +19 -0
- package/dist/cpu.d.ts +1 -0
- package/dist/cpu.js +19 -0
- package/dist/darwin/audio.d.ts +2 -0
- package/dist/darwin/audio.js +46 -0
- package/dist/darwin/baseboard.d.ts +1 -0
- package/dist/darwin/baseboard.js +48 -0
- package/dist/darwin/battery.d.ts +2 -0
- package/dist/darwin/battery.js +65 -0
- package/dist/darwin/bios.d.ts +1 -0
- package/dist/darwin/bios.js +45 -0
- package/dist/darwin/block-devices.d.ts +2 -0
- package/dist/darwin/block-devices.js +101 -0
- package/dist/darwin/bluetooth.d.ts +3 -0
- package/dist/darwin/bluetooth.js +84 -0
- package/dist/darwin/camera.d.ts +2 -0
- package/dist/darwin/camera.js +55 -0
- package/dist/darwin/chassis.d.ts +2 -0
- package/dist/darwin/chassis.js +32 -0
- package/dist/darwin/cpu-cache.d.ts +2 -0
- package/dist/darwin/cpu-cache.js +29 -0
- package/dist/darwin/cpu-flags.d.ts +1 -0
- package/dist/darwin/cpu-flags.js +16 -0
- package/dist/darwin/cpu-temperature.d.ts +1 -0
- package/dist/darwin/cpu-temperature.js +44 -0
- package/dist/darwin/cpu.d.ts +1 -0
- package/dist/darwin/cpu.js +69 -0
- package/dist/darwin/disk-layout.d.ts +2 -0
- package/dist/darwin/disk-layout.js +231 -0
- package/dist/darwin/disks-io.d.ts +2 -0
- package/dist/darwin/disks-io.js +56 -0
- package/dist/darwin/displays.d.ts +2 -0
- package/dist/darwin/displays.js +98 -0
- package/dist/darwin/fs-open-files.d.ts +2 -0
- package/dist/darwin/fs-open-files.js +27 -0
- package/dist/darwin/fs-stats.d.ts +2 -0
- package/dist/darwin/fs-stats.js +47 -0
- package/dist/darwin/gpu.d.ts +2 -0
- package/dist/darwin/gpu.js +55 -0
- package/dist/darwin/index.d.ts +56 -0
- package/dist/darwin/index.js +122 -0
- package/dist/darwin/keyboard.d.ts +2 -0
- package/dist/darwin/keyboard.js +73 -0
- package/dist/darwin/mem-layout.d.ts +2 -0
- package/dist/darwin/mem-layout.js +60 -0
- package/dist/darwin/mem.d.ts +2 -0
- package/dist/darwin/mem.js +50 -0
- package/dist/darwin/mouse.d.ts +2 -0
- package/dist/darwin/mouse.js +78 -0
- package/dist/darwin/network-connections.d.ts +2 -0
- package/dist/darwin/network-connections.js +98 -0
- package/dist/darwin/network-gateway-default.d.ts +1 -0
- package/dist/darwin/network-gateway-default.js +26 -0
- package/dist/darwin/network-interface-default.d.ts +2 -0
- package/dist/darwin/network-interface-default.js +41 -0
- package/dist/darwin/network-interfaces.d.ts +2 -0
- package/dist/darwin/network-interfaces.js +205 -0
- package/dist/darwin/network-stats.d.ts +2 -0
- package/dist/darwin/network-stats.js +86 -0
- package/dist/darwin/npm.d.ts +1 -0
- package/dist/darwin/npm.js +5 -0
- package/dist/darwin/npu.d.ts +2 -0
- package/dist/darwin/npu.js +41 -0
- package/dist/darwin/os-info.d.ts +2 -0
- package/dist/darwin/os-info.js +140 -0
- package/dist/darwin/pci.d.ts +2 -0
- package/dist/darwin/pci.js +37 -0
- package/dist/darwin/printer.d.ts +2 -0
- package/dist/darwin/printer.js +45 -0
- package/dist/darwin/software.d.ts +2 -0
- package/dist/darwin/software.js +39 -0
- package/dist/darwin/system.d.ts +1 -0
- package/dist/darwin/system.js +29 -0
- package/dist/darwin/thunderbolt.d.ts +1 -0
- package/dist/darwin/thunderbolt.js +53 -0
- package/dist/darwin/usb.d.ts +3 -0
- package/dist/darwin/usb.js +69 -0
- package/dist/darwin/users.d.ts +2 -0
- package/dist/darwin/users.js +13 -0
- package/dist/darwin/uuid.d.ts +2 -0
- package/dist/darwin/uuid.js +39 -0
- package/dist/darwin/wifi-connections.d.ts +2 -0
- package/dist/darwin/wifi-connections.js +60 -0
- package/dist/darwin/wifi-interfaces.d.ts +2 -0
- package/dist/darwin/wifi-interfaces.js +27 -0
- package/dist/darwin/wifi-networks.d.ts +2 -0
- package/dist/darwin/wifi-networks.js +61 -0
- package/dist/disk-layout.d.ts +1 -0
- package/dist/disk-layout.js +17 -0
- package/dist/disks-io.d.ts +1 -0
- package/dist/disks-io.js +17 -0
- package/dist/displays.d.ts +1 -0
- package/dist/displays.js +17 -0
- package/dist/docker-socket.d.ts +11 -0
- package/dist/docker-socket.js +113 -0
- package/dist/docker.d.ts +102 -0
- package/dist/docker.js +532 -0
- package/dist/fs-open-files.d.ts +1 -0
- package/dist/fs-open-files.js +17 -0
- package/dist/fs-size.d.ts +1 -0
- package/dist/fs-size.js +23 -0
- package/dist/fs-stats.d.ts +1 -0
- package/dist/fs-stats.js +17 -0
- package/dist/get-data.d.ts +110 -0
- package/dist/get-data.js +151 -0
- package/dist/get.d.ts +5 -0
- package/dist/get.js +117 -0
- package/dist/gpu.d.ts +1 -0
- package/dist/gpu.js +17 -0
- package/dist/index.d.ts +60 -0
- package/dist/index.js +132 -0
- package/dist/inet-checksite.d.ts +1 -0
- package/dist/inet-checksite.js +11 -0
- package/dist/inet-latency.d.ts +1 -0
- package/dist/inet-latency.js +17 -0
- package/dist/inet-public-ip.d.ts +2 -0
- package/dist/inet-public-ip.js +10 -0
- package/dist/keyboard.d.ts +1 -0
- package/dist/keyboard.js +17 -0
- package/dist/linux/audio.d.ts +2 -0
- package/dist/linux/audio.js +67 -0
- package/dist/linux/baseboard.d.ts +1 -0
- package/dist/linux/baseboard.js +81 -0
- package/dist/linux/battery.d.ts +2 -0
- package/dist/linux/battery.js +88 -0
- package/dist/linux/bios.d.ts +2 -0
- package/dist/linux/bios.js +55 -0
- package/dist/linux/block-devices.d.ts +2 -0
- package/dist/linux/block-devices.js +30 -0
- package/dist/linux/bluetooth.d.ts +2 -0
- package/dist/linux/bluetooth.js +86 -0
- package/dist/linux/camera.d.ts +2 -0
- package/dist/linux/camera.js +63 -0
- package/dist/linux/chassis.d.ts +1 -0
- package/dist/linux/chassis.js +41 -0
- package/dist/linux/cpu-cache.d.ts +1 -0
- package/dist/linux/cpu-cache.js +35 -0
- package/dist/linux/cpu-flags.d.ts +1 -0
- package/dist/linux/cpu-flags.js +33 -0
- package/dist/linux/cpu-temperature.d.ts +1 -0
- package/dist/linux/cpu-temperature.js +179 -0
- package/dist/linux/cpu.d.ts +1 -0
- package/dist/linux/cpu.js +135 -0
- package/dist/linux/disk-layout.d.ts +2 -0
- package/dist/linux/disk-layout.js +151 -0
- package/dist/linux/disks-io.d.ts +2 -0
- package/dist/linux/disks-io.js +58 -0
- package/dist/linux/displays.d.ts +2 -0
- package/dist/linux/displays.js +193 -0
- package/dist/linux/fs-open-files.d.ts +2 -0
- package/dist/linux/fs-open-files.js +44 -0
- package/dist/linux/fs-size.d.ts +2 -0
- package/dist/linux/fs-size.js +157 -0
- package/dist/linux/fs-stats.d.ts +2 -0
- package/dist/linux/fs-stats.js +65 -0
- package/dist/linux/gpu.d.ts +15 -0
- package/dist/linux/gpu.js +383 -0
- package/dist/linux/index.d.ts +56 -0
- package/dist/linux/index.js +122 -0
- package/dist/linux/inet-latency.d.ts +1 -0
- package/dist/linux/inet-latency.js +39 -0
- package/dist/linux/keyboard.d.ts +2 -0
- package/dist/linux/keyboard.js +61 -0
- package/dist/linux/mem-layout.d.ts +2 -0
- package/dist/linux/mem-layout.js +112 -0
- package/dist/linux/mem.d.ts +2 -0
- package/dist/linux/mem.js +61 -0
- package/dist/linux/mouse.d.ts +2 -0
- package/dist/linux/mouse.js +73 -0
- package/dist/linux/network-connections.d.ts +2 -0
- package/dist/linux/network-connections.js +114 -0
- package/dist/linux/network-gateway-default.d.ts +1 -0
- package/dist/linux/network-gateway-default.js +22 -0
- package/dist/linux/network-interface-default.d.ts +2 -0
- package/dist/linux/network-interface-default.js +46 -0
- package/dist/linux/network-interfaces.d.ts +3 -0
- package/dist/linux/network-interfaces.js +353 -0
- package/dist/linux/network-stats.d.ts +2 -0
- package/dist/linux/network-stats.js +99 -0
- package/dist/linux/npm.d.ts +1 -0
- package/dist/linux/npm.js +5 -0
- package/dist/linux/npu.d.ts +2 -0
- package/dist/linux/npu.js +77 -0
- package/dist/linux/os-info.d.ts +1 -0
- package/dist/linux/os-info.js +114 -0
- package/dist/linux/pci.d.ts +2 -0
- package/dist/linux/pci.js +56 -0
- package/dist/linux/printer.d.ts +2 -0
- package/dist/linux/printer.js +80 -0
- package/dist/linux/process-load.d.ts +2 -0
- package/dist/linux/process-load.js +164 -0
- package/dist/linux/processes.d.ts +2 -0
- package/dist/linux/processes.js +358 -0
- package/dist/linux/services.d.ts +2 -0
- package/dist/linux/services.js +222 -0
- package/dist/linux/software.d.ts +2 -0
- package/dist/linux/software.js +110 -0
- package/dist/linux/system.d.ts +1 -0
- package/dist/linux/system.js +186 -0
- package/dist/linux/thunderbolt.d.ts +2 -0
- package/dist/linux/thunderbolt.js +51 -0
- package/dist/linux/time.d.ts +6 -0
- package/dist/linux/time.js +28 -0
- package/dist/linux/usb.d.ts +2 -0
- package/dist/linux/usb.js +62 -0
- package/dist/linux/users.d.ts +2 -0
- package/dist/linux/users.js +102 -0
- package/dist/linux/uuid.d.ts +2 -0
- package/dist/linux/uuid.js +44 -0
- package/dist/linux/wifi-connections.d.ts +2 -0
- package/dist/linux/wifi-connections.js +196 -0
- package/dist/linux/wifi-interfaces.d.ts +2 -0
- package/dist/linux/wifi-interfaces.js +96 -0
- package/dist/linux/wifi-networks.d.ts +2 -0
- package/dist/linux/wifi-networks.js +176 -0
- package/dist/mem-layout.d.ts +1 -0
- package/dist/mem-layout.js +17 -0
- package/dist/mem.d.ts +1 -0
- package/dist/mem.js +19 -0
- package/dist/mouse.d.ts +1 -0
- package/dist/mouse.js +17 -0
- package/dist/network-connections.d.ts +1 -0
- package/dist/network-connections.js +17 -0
- package/dist/network-gateway-default.d.ts +1 -0
- package/dist/network-gateway-default.js +17 -0
- package/dist/network-interface-default.d.ts +1 -0
- package/dist/network-interface-default.js +17 -0
- package/dist/network-interfaces.d.ts +1 -0
- package/dist/network-interfaces.js +18 -0
- package/dist/network-stats.d.ts +1 -0
- package/dist/network-stats.js +19 -0
- package/dist/npm.d.ts +2 -0
- package/dist/npm.js +22 -0
- package/dist/npu.d.ts +1 -0
- package/dist/npu.js +17 -0
- package/dist/observe.d.ts +5 -0
- package/dist/observe.js +16 -0
- package/dist/os-info.d.ts +1 -0
- package/dist/os-info.js +21 -0
- package/dist/pci.d.ts +1 -0
- package/dist/pci.js +17 -0
- package/dist/printer.d.ts +1 -0
- package/dist/printer.js +17 -0
- package/dist/process-load.d.ts +1 -0
- package/dist/process-load.js +15 -0
- package/dist/processes.d.ts +1 -0
- package/dist/processes.js +15 -0
- package/dist/services.d.ts +1 -0
- package/dist/services.js +15 -0
- package/dist/shell.d.ts +1 -0
- package/dist/shell.js +16 -0
- package/dist/software.d.ts +1 -0
- package/dist/software.js +17 -0
- package/dist/sun/index.d.ts +17 -0
- package/dist/sun/index.js +43 -0
- package/dist/sun/inet-latency.d.ts +1 -0
- package/dist/sun/inet-latency.js +30 -0
- package/dist/sun/os-info.d.ts +1 -0
- package/dist/sun/os-info.js +26 -0
- package/dist/sun/users.d.ts +2 -0
- package/dist/sun/users.js +13 -0
- package/dist/system.d.ts +1 -0
- package/dist/system.js +17 -0
- package/dist/thunderbolt.d.ts +1 -0
- package/dist/thunderbolt.js +17 -0
- package/dist/time.d.ts +6 -0
- package/dist/time.js +28 -0
- package/dist/usb.d.ts +1 -0
- package/dist/usb.js +17 -0
- package/dist/users.d.ts +1 -0
- package/dist/users.js +21 -0
- package/dist/uuid.d.ts +1 -0
- package/dist/uuid.js +19 -0
- package/dist/version.d.ts +1 -0
- package/dist/version.js +16 -0
- package/dist/versions.d.ts +2 -0
- package/dist/versions.js +1150 -0
- package/dist/virtualbox.d.ts +2 -0
- package/dist/virtualbox.js +89 -0
- package/dist/wifi-connections.d.ts +1 -0
- package/dist/wifi-connections.js +17 -0
- package/dist/wifi-interfaces.d.ts +1 -0
- package/dist/wifi-interfaces.js +17 -0
- package/dist/wifi-networks.d.ts +1 -0
- package/dist/wifi-networks.js +17 -0
- package/dist/windows/audio.d.ts +2 -0
- package/dist/windows/audio.js +23 -0
- package/dist/windows/baseboard.d.ts +1 -0
- package/dist/windows/baseboard.js +35 -0
- package/dist/windows/battery.d.ts +1 -0
- package/dist/windows/battery.js +81 -0
- package/dist/windows/bios.d.ts +1 -0
- package/dist/windows/bios.js +37 -0
- package/dist/windows/block-devices.d.ts +3 -0
- package/dist/windows/block-devices.js +58 -0
- package/dist/windows/bluetooth.d.ts +2 -0
- package/dist/windows/bluetooth.js +31 -0
- package/dist/windows/camera.d.ts +2 -0
- package/dist/windows/camera.js +47 -0
- package/dist/windows/chassis.d.ts +1 -0
- package/dist/windows/chassis.js +29 -0
- package/dist/windows/cpu-cache.d.ts +2 -0
- package/dist/windows/cpu-cache.js +59 -0
- package/dist/windows/cpu-flags.d.ts +1 -0
- package/dist/windows/cpu-flags.js +61 -0
- package/dist/windows/cpu-temperature.d.ts +1 -0
- package/dist/windows/cpu-temperature.js +32 -0
- package/dist/windows/cpu.d.ts +1 -0
- package/dist/windows/cpu.js +96 -0
- package/dist/windows/disk-layout.d.ts +2 -0
- package/dist/windows/disk-layout.js +129 -0
- package/dist/windows/disks-io.d.ts +2 -0
- package/dist/windows/disks-io.js +46 -0
- package/dist/windows/displays.d.ts +2 -0
- package/dist/windows/displays.js +213 -0
- package/dist/windows/fs-open-files.d.ts +2 -0
- package/dist/windows/fs-open-files.js +22 -0
- package/dist/windows/fs-size.d.ts +2 -0
- package/dist/windows/fs-size.js +47 -0
- package/dist/windows/fs-stats.d.ts +2 -0
- package/dist/windows/fs-stats.js +37 -0
- package/dist/windows/gpu.d.ts +2 -0
- package/dist/windows/gpu.js +128 -0
- package/dist/windows/index.d.ts +56 -0
- package/dist/windows/index.js +122 -0
- package/dist/windows/inet-latency.d.ts +1 -0
- package/dist/windows/inet-latency.js +34 -0
- package/dist/windows/keyboard.d.ts +2 -0
- package/dist/windows/keyboard.js +47 -0
- package/dist/windows/mem-layout.d.ts +2 -0
- package/dist/windows/mem-layout.js +39 -0
- package/dist/windows/mem.d.ts +2 -0
- package/dist/windows/mem.js +33 -0
- package/dist/windows/mouse.d.ts +2 -0
- package/dist/windows/mouse.js +64 -0
- package/dist/windows/network-connections.d.ts +2 -0
- package/dist/windows/network-connections.js +93 -0
- package/dist/windows/network-gateway-default.d.ts +1 -0
- package/dist/windows/network-gateway-default.js +36 -0
- package/dist/windows/network-interface-default.d.ts +2 -0
- package/dist/windows/network-interface-default.js +56 -0
- package/dist/windows/network-interfaces.d.ts +2 -0
- package/dist/windows/network-interfaces.js +346 -0
- package/dist/windows/network-stats.d.ts +2 -0
- package/dist/windows/network-stats.js +135 -0
- package/dist/windows/npm.d.ts +1 -0
- package/dist/windows/npm.js +5 -0
- package/dist/windows/npu.d.ts +2 -0
- package/dist/windows/npu.js +29 -0
- package/dist/windows/os-info.d.ts +1 -0
- package/dist/windows/os-info.js +70 -0
- package/dist/windows/pci.d.ts +2 -0
- package/dist/windows/pci.js +33 -0
- package/dist/windows/printer.d.ts +2 -0
- package/dist/windows/printer.js +36 -0
- package/dist/windows/process-load.d.ts +2 -0
- package/dist/windows/process-load.js +121 -0
- package/dist/windows/processes.d.ts +9 -0
- package/dist/windows/processes.js +139 -0
- package/dist/windows/services.d.ts +2 -0
- package/dist/windows/services.js +83 -0
- package/dist/windows/shell.d.ts +1 -0
- package/dist/windows/shell.js +19 -0
- package/dist/windows/software.d.ts +2 -0
- package/dist/windows/software.js +53 -0
- package/dist/windows/system.d.ts +1 -0
- package/dist/windows/system.js +98 -0
- package/dist/windows/thunderbolt.d.ts +2 -0
- package/dist/windows/thunderbolt.js +34 -0
- package/dist/windows/usb.d.ts +2 -0
- package/dist/windows/usb.js +37 -0
- package/dist/windows/users.d.ts +2 -0
- package/dist/windows/users.js +151 -0
- package/dist/windows/uuid.d.ts +2 -0
- package/dist/windows/uuid.js +28 -0
- package/dist/windows/wifi-connections.d.ts +2 -0
- package/dist/windows/wifi-connections.js +56 -0
- package/dist/windows/wifi-interfaces.d.ts +2 -0
- package/dist/windows/wifi-interfaces.js +45 -0
- package/dist/windows/wifi-networks.d.ts +2 -0
- package/dist/windows/wifi-networks.js +50 -0
- package/package.json +78 -12
- package/lib/audio.js +0 -277
- package/lib/battery.js +0 -334
- package/lib/bluetooth.js +0 -315
- package/lib/bluetoothVendors.js +0 -1138
- package/lib/cli.js +0 -100
- package/lib/cpu.js +0 -2285
- package/lib/docker.js +0 -791
- package/lib/dockerSocket.js +0 -117
- package/lib/filesystem.js +0 -1849
- package/lib/graphics.js +0 -1321
- package/lib/index.d.ts +0 -1051
- package/lib/index.js +0 -520
- package/lib/internet.js +0 -259
- package/lib/memory.js +0 -622
- package/lib/network.js +0 -2008
- package/lib/osinfo.js +0 -1322
- package/lib/printer.js +0 -209
- package/lib/processes.js +0 -1459
- package/lib/system.js +0 -855
- package/lib/usb.js +0 -309
- package/lib/users.js +0 -412
- package/lib/util.js +0 -2833
- package/lib/virtualbox.js +0 -116
- package/lib/wifi.js +0 -839
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.cpuTemperature = void 0;
|
|
4
|
+
const promises_1 = require("fs/promises");
|
|
5
|
+
const const_1 = require("../common/const");
|
|
6
|
+
const common_1 = require("../common");
|
|
7
|
+
const defaults_1 = require("../common/defaults");
|
|
8
|
+
const exec_1 = require("../common/exec");
|
|
9
|
+
const files_1 = require("../common/files");
|
|
10
|
+
const cpuTemperature = async () => {
|
|
11
|
+
await (0, common_1.nextTick)();
|
|
12
|
+
const result = (0, common_1.cloneObj)(defaults_1.initCpuTemperature);
|
|
13
|
+
let cpuThermal = null;
|
|
14
|
+
try {
|
|
15
|
+
const cmd = 'cat /sys/class/thermal/thermal_zone*/type 2>/dev/null; echo "-----"; cat /sys/class/thermal/thermal_zone*/temp 2>/dev/null;';
|
|
16
|
+
const { stdout } = await (0, exec_1.exec)(cmd, const_1.execOptsLinux);
|
|
17
|
+
const parts = stdout.split('-----\n');
|
|
18
|
+
if (parts.length === 2) {
|
|
19
|
+
const lines = parts[0].split('\n');
|
|
20
|
+
const lines2 = parts[1].split('\n');
|
|
21
|
+
for (let i = 0; i < lines.length; i++) {
|
|
22
|
+
const line = lines[i].trim();
|
|
23
|
+
if (line.startsWith('acpi') && lines2[i]) {
|
|
24
|
+
result.socket.push(Math.round(Number.parseInt(lines2[i], 10) / 100) / 10);
|
|
25
|
+
}
|
|
26
|
+
if (line.startsWith('pch') && lines2[i]) {
|
|
27
|
+
result.chipset = Math.round(Number.parseInt(lines2[i], 10) / 100) / 10;
|
|
28
|
+
}
|
|
29
|
+
if (cpuThermal === null && line.indexOf('cpu') !== -1 && lines2[i]) {
|
|
30
|
+
cpuThermal = Math.round(parseInt(lines2[i], 10) / 100) / 10;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
catch { }
|
|
36
|
+
const cmd = 'for mon in /sys/class/hwmon/hwmon*; do for label in "$mon"/temp*_label; do if [ -f $label ]; then value=${label%_*}_input; echo $(cat "$label")___$(cat "$value"); fi; done; done;';
|
|
37
|
+
try {
|
|
38
|
+
let { stdout } = await (0, exec_1.exec)(cmd, const_1.execOptsLinux);
|
|
39
|
+
const tdiePos = stdout.toLowerCase().indexOf('tdie');
|
|
40
|
+
if (tdiePos !== -1) {
|
|
41
|
+
stdout = stdout.substring(tdiePos);
|
|
42
|
+
}
|
|
43
|
+
let tctl = 0;
|
|
44
|
+
let lines = stdout.split('\n');
|
|
45
|
+
lines.forEach((line) => {
|
|
46
|
+
const parts = line.split('___');
|
|
47
|
+
const label = parts[0];
|
|
48
|
+
const value = parts.length > 1 && parts[1] ? parts[1] : '0';
|
|
49
|
+
if (value && label && label.toLowerCase() === 'tctl') {
|
|
50
|
+
tctl = result.main = Math.round(Number.parseInt(value, 10) / 100) / 10;
|
|
51
|
+
}
|
|
52
|
+
if (value && (label === undefined || label?.toLowerCase().startsWith('core'))) {
|
|
53
|
+
result.cores.push(Math.round(Number.parseInt(value, 10) / 100) / 10);
|
|
54
|
+
}
|
|
55
|
+
else if ((value && label && result.main === null && (label.toLowerCase().includes('package') || label.toLowerCase().includes('physical'))) || label.toLowerCase() === 'tccd1') {
|
|
56
|
+
result.main = Math.round(Number.parseInt(value, 10) / 100) / 10;
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
if (tctl && result.main === null) {
|
|
60
|
+
result.main = tctl;
|
|
61
|
+
}
|
|
62
|
+
if (result.cores.length > 0) {
|
|
63
|
+
if (result.main === null) {
|
|
64
|
+
result.main = Math.round(result.cores.reduce((a, b) => a + b, 0) / result.cores.length);
|
|
65
|
+
}
|
|
66
|
+
const maxtmp = Math.max(...result.cores);
|
|
67
|
+
result.max = maxtmp > result.main ? maxtmp : result.main;
|
|
68
|
+
}
|
|
69
|
+
if (result.main !== null) {
|
|
70
|
+
if (result.max === null) {
|
|
71
|
+
result.max = result.main;
|
|
72
|
+
}
|
|
73
|
+
return result;
|
|
74
|
+
}
|
|
75
|
+
if (cpuThermal !== null) {
|
|
76
|
+
result.main = cpuThermal;
|
|
77
|
+
result.max = cpuThermal;
|
|
78
|
+
return result;
|
|
79
|
+
}
|
|
80
|
+
({ stdout } = await (0, exec_1.exec)('sensors', const_1.execOptsLinux));
|
|
81
|
+
lines = stdout.split('\n');
|
|
82
|
+
let tdieTemp = null;
|
|
83
|
+
let cpuThermalTemp = null;
|
|
84
|
+
let newSectionStarts = true;
|
|
85
|
+
let section = '';
|
|
86
|
+
lines.forEach((line) => {
|
|
87
|
+
if (line.trim() === '') {
|
|
88
|
+
newSectionStarts = true;
|
|
89
|
+
}
|
|
90
|
+
else if (newSectionStarts) {
|
|
91
|
+
const s = line.trim().toLowerCase();
|
|
92
|
+
if (s.startsWith('acpi'))
|
|
93
|
+
section = 'acpi';
|
|
94
|
+
else if (s.startsWith('pch'))
|
|
95
|
+
section = 'pch';
|
|
96
|
+
else if (s.startsWith('coretemp') || s.startsWith('core'))
|
|
97
|
+
section = 'core';
|
|
98
|
+
else if (s.startsWith('k10temp'))
|
|
99
|
+
section = 'coreAMD';
|
|
100
|
+
else if (s.startsWith('cpu_thermal') || s.startsWith('cpu-thermal') || s.startsWith('soc_thermal') || s.startsWith('cpu'))
|
|
101
|
+
section = 'cpuThermal';
|
|
102
|
+
else
|
|
103
|
+
section = 'other';
|
|
104
|
+
newSectionStarts = false;
|
|
105
|
+
}
|
|
106
|
+
const regex = /[+-]([^°]*)/g;
|
|
107
|
+
const tempsArray = line.match(regex);
|
|
108
|
+
const temps = tempsArray?.length ? tempsArray[0] : '';
|
|
109
|
+
const firstPart = line.split(':')[0].toUpperCase();
|
|
110
|
+
if (section === 'acpi') {
|
|
111
|
+
if (firstPart.includes('TEMP') && temps) {
|
|
112
|
+
result.socket.push(Number.parseFloat(temps));
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
else if (section === 'pch') {
|
|
116
|
+
if (firstPart.includes('TEMP') && !result.chipset && temps) {
|
|
117
|
+
result.chipset = Number.parseFloat(temps);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
if ((firstPart.includes('PHYSICAL') || firstPart.includes('PACKAGE') || (section === 'coreAMD' && firstPart.includes('TDIE')) || firstPart.includes('TEMP')) && temps) {
|
|
121
|
+
result.main = Number.parseFloat(temps);
|
|
122
|
+
}
|
|
123
|
+
if (firstPart.includes('CORE ') && temps) {
|
|
124
|
+
result.cores.push(Number.parseFloat(temps));
|
|
125
|
+
}
|
|
126
|
+
if (firstPart.includes('TDIE') && tdieTemp === null && temps) {
|
|
127
|
+
tdieTemp = Number.parseFloat(temps);
|
|
128
|
+
}
|
|
129
|
+
if (section === 'cpuThermal' && firstPart.indexOf('TEMP') !== -1 && cpuThermalTemp === null && temps) {
|
|
130
|
+
cpuThermalTemp = parseFloat(temps);
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
if (result.cores.length > 0) {
|
|
134
|
+
if (result.main === null) {
|
|
135
|
+
result.main = Math.round(result.cores.reduce((a, b) => a + b, 0) / result.cores.length);
|
|
136
|
+
}
|
|
137
|
+
const maxtmp = Math.max(...result.cores);
|
|
138
|
+
result.max = maxtmp > result.main ? maxtmp : result.main;
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
if (result.main === null && cpuThermalTemp !== null) {
|
|
142
|
+
result.main = cpuThermalTemp;
|
|
143
|
+
result.max = cpuThermalTemp;
|
|
144
|
+
}
|
|
145
|
+
else if (result.main === null && tdieTemp !== null) {
|
|
146
|
+
result.main = tdieTemp;
|
|
147
|
+
result.max = tdieTemp;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
if (result.main !== null && result.max === null) {
|
|
151
|
+
result.max = result.main;
|
|
152
|
+
}
|
|
153
|
+
if (result.main !== null || result.max !== null) {
|
|
154
|
+
return result;
|
|
155
|
+
}
|
|
156
|
+
if (await (0, files_1.fileExists)('/sys/class/thermal/thermal_zone0/temp')) {
|
|
157
|
+
stdout = (await (0, promises_1.readFile)('/sys/class/thermal/thermal_zone0/temp')).toString();
|
|
158
|
+
const lines = stdout.toString().split('\n');
|
|
159
|
+
if (lines.length > 0) {
|
|
160
|
+
result.main = Number.parseFloat(lines[0]) / 1000;
|
|
161
|
+
result.max = result.main;
|
|
162
|
+
}
|
|
163
|
+
return result;
|
|
164
|
+
}
|
|
165
|
+
else {
|
|
166
|
+
({ stdout } = await (0, exec_1.exec)('/opt/vc/bin/vcgencmd measure_temp', const_1.execOptsLinux));
|
|
167
|
+
const lines = stdout.split('\n');
|
|
168
|
+
if (lines.length > 0 && lines[0].indexOf('=') !== -1) {
|
|
169
|
+
result.main = Number.parseFloat(lines[0].split('=')[1]);
|
|
170
|
+
result.max = result.main;
|
|
171
|
+
}
|
|
172
|
+
return result;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
catch {
|
|
176
|
+
return result;
|
|
177
|
+
}
|
|
178
|
+
};
|
|
179
|
+
exports.cpuTemperature = cpuTemperature;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const cpu: () => Promise<any>;
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.cpu = void 0;
|
|
4
|
+
const promises_1 = require("node:fs/promises");
|
|
5
|
+
const node_os_1 = require("node:os");
|
|
6
|
+
const common_1 = require("../common");
|
|
7
|
+
const const_1 = require("../common/const");
|
|
8
|
+
const cpu_1 = require("../common/cpu");
|
|
9
|
+
const defaults_1 = require("../common/defaults");
|
|
10
|
+
const exec_1 = require("../common/exec");
|
|
11
|
+
const mappings_1 = require("../common/mappings");
|
|
12
|
+
const parse_1 = require("../common/parse");
|
|
13
|
+
const raspberry_1 = require("./../common/raspberry");
|
|
14
|
+
const raspberry_2 = require("../common/raspberry");
|
|
15
|
+
const cpu_current_speed_1 = require("../cpu-current-speed");
|
|
16
|
+
const cpu_flags_1 = require("./cpu-flags");
|
|
17
|
+
(0, cpu_1.setCpuSpeed)(0);
|
|
18
|
+
const cpu = async () => {
|
|
19
|
+
await (0, common_1.nextTick)();
|
|
20
|
+
const defaults = (0, common_1.cloneObj)(defaults_1.initCpuResult);
|
|
21
|
+
const cores = defaults.cores;
|
|
22
|
+
const flags = await (0, cpu_flags_1.cpuFlags)();
|
|
23
|
+
const virtualization = flags.indexOf('vmx') > -1 || flags.indexOf('svm') > -1;
|
|
24
|
+
let modelline = '';
|
|
25
|
+
if ((0, node_os_1.cpus)()[0] && (0, node_os_1.cpus)()[0].model) {
|
|
26
|
+
modelline = (0, node_os_1.cpus)()[0].model;
|
|
27
|
+
}
|
|
28
|
+
let { stdout } = await (0, exec_1.exec)('export LC_ALL=C; lscpu; echo -n "Governor: "; cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor 2>/dev/null; echo; unset LC_ALL', const_1.execOptsLinux);
|
|
29
|
+
let lines = stdout.toString().split('\n');
|
|
30
|
+
modelline = (0, common_1.getValue)(lines, 'model name') || modelline;
|
|
31
|
+
modelline = (0, common_1.getValue)(lines, 'bios model name') || modelline;
|
|
32
|
+
modelline = (0, common_1.cleanString)(modelline);
|
|
33
|
+
const modellineParts = modelline.split('@');
|
|
34
|
+
let brand = modellineParts[0].trim();
|
|
35
|
+
if (brand.indexOf('Unknown') >= 0) {
|
|
36
|
+
brand = brand.split('Unknown')[0].trim();
|
|
37
|
+
}
|
|
38
|
+
let speed = modellineParts[1] ? parseFloat(modellineParts[1].trim()) : 0;
|
|
39
|
+
if (speed === 0 && (brand.indexOf('AMD') > -1 || brand.toLowerCase().indexOf('ryzen') > -1)) {
|
|
40
|
+
speed = (0, mappings_1.getAMDSpeed)(brand);
|
|
41
|
+
}
|
|
42
|
+
if (speed === 0) {
|
|
43
|
+
const current = await (0, cpu_current_speed_1.getCpuCurrentSpeed)();
|
|
44
|
+
if (current.avg !== 0) {
|
|
45
|
+
speed = current.avg;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
(0, cpu_1.setCpuSpeed)(speed);
|
|
49
|
+
const speedMin = Math.round(parseFloat((0, common_1.getValue)(lines, 'cpu min mhz').replace(/,/g, '.')) / 10.0) / 100 || defaults.speedMin;
|
|
50
|
+
const speedMax = Math.round(parseFloat((0, common_1.getValue)(lines, 'cpu max mhz').replace(/,/g, '.')) / 10.0) / 100 || defaults.speedMax;
|
|
51
|
+
const brandManufacturer = (0, mappings_1.cpuBrandManufacturer)(brand);
|
|
52
|
+
brand = brandManufacturer.brand;
|
|
53
|
+
let manufacturer = brandManufacturer.manufacturer;
|
|
54
|
+
const vendor = (0, mappings_1.cpuManufacturer)((0, common_1.getValue)(lines, 'vendor id'));
|
|
55
|
+
let family = (0, common_1.getValue)(lines, 'cpu family');
|
|
56
|
+
const model = (0, common_1.getValue)(lines, 'model:');
|
|
57
|
+
const stepping = (0, common_1.getValue)(lines, 'stepping');
|
|
58
|
+
let revision = (0, common_1.getValue)(lines, 'cpu revision');
|
|
59
|
+
const cache = defaults_1.initCpuCacheResult;
|
|
60
|
+
const l1d = (0, common_1.getValue)(lines, 'l1d cache');
|
|
61
|
+
if (l1d) {
|
|
62
|
+
cache.l1d = (0, common_1.toInt)(l1d) * (l1d.indexOf('M') !== -1 ? 1024 * 1024 : (0, parse_1.kFactor)(l1d));
|
|
63
|
+
}
|
|
64
|
+
const l1i = (0, common_1.getValue)(lines, 'l1i cache');
|
|
65
|
+
if (l1i) {
|
|
66
|
+
cache.l1i = (0, common_1.toInt)(l1i) * (l1i.indexOf('M') !== -1 ? 1024 * 1024 : (0, parse_1.kFactor)(l1i));
|
|
67
|
+
}
|
|
68
|
+
const l2 = (0, common_1.getValue)(lines, 'l2 cache');
|
|
69
|
+
if (l2) {
|
|
70
|
+
cache.l2 = (0, common_1.toInt)(l2) * (l2.indexOf('M') !== -1 ? 1024 * 1024 : (0, parse_1.kFactor)(l2));
|
|
71
|
+
}
|
|
72
|
+
const l3 = (0, common_1.getValue)(lines, 'l3 cache');
|
|
73
|
+
if (l3) {
|
|
74
|
+
cache.l3 = (0, common_1.toInt)(l3) * (l3.indexOf('M') !== -1 ? 1024 * 1024 : (0, parse_1.kFactor)(l3));
|
|
75
|
+
}
|
|
76
|
+
const threadsPerCore = (0, common_1.getValue)(lines, 'thread(s) per core') || '1';
|
|
77
|
+
let processors = (0, common_1.toInt)((0, common_1.getValue)(lines, 'socket(s)')) || 1;
|
|
78
|
+
const threadsPerCoreInt = (0, common_1.toInt)(threadsPerCore);
|
|
79
|
+
const processorsInt = (0, common_1.toInt)(processors);
|
|
80
|
+
const coresPerSocket = (0, common_1.toInt)((0, common_1.getValue)(lines, 'core(s) per socket'));
|
|
81
|
+
const physicalCores = coresPerSocket ? coresPerSocket * processorsInt : cores / threadsPerCoreInt;
|
|
82
|
+
const performanceCores = threadsPerCoreInt > 1 ? cores - physicalCores : cores;
|
|
83
|
+
const efficiencyCores = threadsPerCoreInt > 1 ? cores - threadsPerCoreInt * performanceCores : 0;
|
|
84
|
+
processors = processorsInt;
|
|
85
|
+
const governor = (0, common_1.getValue)(lines, 'governor') || '';
|
|
86
|
+
let socket = vendor === 'ARM' ? 'SOC' : defaults.socket;
|
|
87
|
+
if (vendor === 'ARM' && (await (0, raspberry_1.isRaspberry)())) {
|
|
88
|
+
const rPIRevision = (0, raspberry_2.decodePiCpuinfo)();
|
|
89
|
+
family = manufacturer;
|
|
90
|
+
manufacturer = rPIRevision.manufacturer;
|
|
91
|
+
brand = rPIRevision.processor;
|
|
92
|
+
revision = rPIRevision.revisionCode;
|
|
93
|
+
socket = 'SOC';
|
|
94
|
+
}
|
|
95
|
+
if ((0, common_1.getValue)(lines, 'architecture') === 'riscv64') {
|
|
96
|
+
try {
|
|
97
|
+
const linesRiscV = (await (0, promises_1.readFile)('/proc/cpuinfo')).toString().split('\n');
|
|
98
|
+
const uarch = (0, common_1.getValue)(linesRiscV, 'uarch') || '';
|
|
99
|
+
if (uarch.indexOf(',') > -1) {
|
|
100
|
+
const split = uarch.split(',');
|
|
101
|
+
manufacturer = (0, mappings_1.cpuManufacturer)(split[0]);
|
|
102
|
+
brand = split[1];
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
catch { }
|
|
106
|
+
}
|
|
107
|
+
({ stdout } = await (0, exec_1.exec)('export LC_ALL=C; dmidecode -t 4 2>/dev/null | grep "Upgrade: Socket"; unset LC_ALL', const_1.execOptsLinux));
|
|
108
|
+
lines = stdout.toString().split('\n');
|
|
109
|
+
if (lines && lines.length) {
|
|
110
|
+
socket = (0, common_1.getValue)(lines, 'Upgrade').replace('Socket', '').trim() || socket;
|
|
111
|
+
}
|
|
112
|
+
return {
|
|
113
|
+
...defaults,
|
|
114
|
+
manufacturer,
|
|
115
|
+
brand,
|
|
116
|
+
vendor,
|
|
117
|
+
family,
|
|
118
|
+
model,
|
|
119
|
+
stepping,
|
|
120
|
+
revision,
|
|
121
|
+
speed,
|
|
122
|
+
speedMin,
|
|
123
|
+
speedMax,
|
|
124
|
+
governor,
|
|
125
|
+
physicalCores,
|
|
126
|
+
performanceCores,
|
|
127
|
+
efficiencyCores,
|
|
128
|
+
processors,
|
|
129
|
+
socket,
|
|
130
|
+
flags,
|
|
131
|
+
virtualization,
|
|
132
|
+
cache
|
|
133
|
+
};
|
|
134
|
+
};
|
|
135
|
+
exports.cpu = cpu;
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.diskLayout = void 0;
|
|
4
|
+
const common_1 = require("../common");
|
|
5
|
+
const const_1 = require("../common/const");
|
|
6
|
+
const exec_1 = require("../common/exec");
|
|
7
|
+
const filesys_1 = require("../common/filesys");
|
|
8
|
+
const mappings_1 = require("../common/mappings");
|
|
9
|
+
const security_1 = require("../common/security");
|
|
10
|
+
const diskLayout = async () => {
|
|
11
|
+
await (0, common_1.nextTick)();
|
|
12
|
+
const result = [];
|
|
13
|
+
let stdout = '';
|
|
14
|
+
let cmd = '';
|
|
15
|
+
let cmdFullSmart = '';
|
|
16
|
+
try {
|
|
17
|
+
({ stdout } = await (0, exec_1.exec)('export LC_ALL=C; lsblk -ablJO 2>/dev/null; unset LC_ALL', const_1.execOptsLinux));
|
|
18
|
+
const out = stdout.trim();
|
|
19
|
+
let devices = [];
|
|
20
|
+
try {
|
|
21
|
+
const outJSON = JSON.parse(out);
|
|
22
|
+
if (outJSON && Object.keys(outJSON).includes('blockdevices')) {
|
|
23
|
+
devices = outJSON.blockdevices.filter((item) => {
|
|
24
|
+
return (item.type === 'disk' &&
|
|
25
|
+
item.size > 0 &&
|
|
26
|
+
(item.model !== null ||
|
|
27
|
+
(item.mountpoint === null &&
|
|
28
|
+
item.label === null &&
|
|
29
|
+
item.fstype === null &&
|
|
30
|
+
item.parttype === null &&
|
|
31
|
+
item.path &&
|
|
32
|
+
item.path.indexOf('/ram') !== 0 &&
|
|
33
|
+
item.path.indexOf('/loop') !== 0 &&
|
|
34
|
+
item['disc-max'] &&
|
|
35
|
+
item['disc-max'] !== 0)));
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
catch (e) {
|
|
40
|
+
try {
|
|
41
|
+
({ stdout } = await (0, exec_1.exec)('export LC_ALL=C; lsblk -bPo NAME,TYPE,SIZE,FSTYPE,MOUNTPOINT,UUID,ROTA,RO,RM,LABEL,MODEL,OWNER,GROUP 2>/dev/null; unset LC_ALL', const_1.execOptsLinux));
|
|
42
|
+
const lines = (0, filesys_1.blkStdoutToObject)(stdout).split('\n');
|
|
43
|
+
const data = (0, filesys_1.parseLinuxBlk)(lines);
|
|
44
|
+
devices = data.filter((item) => {
|
|
45
|
+
return item.type === 'disk' && item.size > 0 && ((item.model !== null && item.model !== '') || (item.mount === '' && item.label === '' && item.fsType === ''));
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
catch { }
|
|
49
|
+
}
|
|
50
|
+
for (const device of devices) {
|
|
51
|
+
let mediumType = '';
|
|
52
|
+
const logical = (0, security_1.sanitizeShellString)(device.name || '', true);
|
|
53
|
+
const bsdName = '/dev/' + logical;
|
|
54
|
+
try {
|
|
55
|
+
({ stdout } = await (0, exec_1.exec)('cat /sys/block/' + logical + '/queue/rotational 2>/dev/null', const_1.execOptsLinux));
|
|
56
|
+
mediumType = stdout.split('\n')[0];
|
|
57
|
+
}
|
|
58
|
+
catch { }
|
|
59
|
+
let interfaceType = device.tran ? device.tran.toUpperCase().trim() : '';
|
|
60
|
+
if (interfaceType === 'NVME') {
|
|
61
|
+
mediumType = '2';
|
|
62
|
+
interfaceType = 'PCIe';
|
|
63
|
+
}
|
|
64
|
+
result.push({
|
|
65
|
+
device: bsdName,
|
|
66
|
+
type: mediumType === '0'
|
|
67
|
+
? 'SSD'
|
|
68
|
+
: mediumType === '1'
|
|
69
|
+
? 'HD'
|
|
70
|
+
: mediumType === '2'
|
|
71
|
+
? 'NVMe'
|
|
72
|
+
: device.model && device.model.indexOf('SSD') > -1
|
|
73
|
+
? 'SSD'
|
|
74
|
+
: device.model && device.model.indexOf('NVM') > -1
|
|
75
|
+
? 'NVMe'
|
|
76
|
+
: 'HD',
|
|
77
|
+
name: device.model || '',
|
|
78
|
+
vendor: (0, mappings_1.diskVendorFromModel)(device.model) || (device.vendor ? device.vendor.trim() : ''),
|
|
79
|
+
size: device.size || 0,
|
|
80
|
+
bytesPerSector: null,
|
|
81
|
+
totalCylinders: null,
|
|
82
|
+
totalHeads: null,
|
|
83
|
+
totalSectors: null,
|
|
84
|
+
totalTracks: null,
|
|
85
|
+
tracksPerCylinder: null,
|
|
86
|
+
sectorsPerTrack: null,
|
|
87
|
+
firmwareRevision: device.rev ? device.rev.trim() : '',
|
|
88
|
+
serialNum: device.serial ? device.serial.trim() : '',
|
|
89
|
+
interfaceType: interfaceType,
|
|
90
|
+
smartStatus: 'unknown',
|
|
91
|
+
temperature: null,
|
|
92
|
+
bsdName: bsdName
|
|
93
|
+
});
|
|
94
|
+
cmd += `printf "\n${bsdName}|"; smartctl -H ${bsdName} | grep overall;`;
|
|
95
|
+
cmdFullSmart += `${cmdFullSmart ? 'printf ",";' : ''}smartctl -a -j ${bsdName};`;
|
|
96
|
+
}
|
|
97
|
+
try {
|
|
98
|
+
({ stdout } = await (0, exec_1.exec)(cmdFullSmart, const_1.execOptsLinux));
|
|
99
|
+
const data = JSON.parse(`[${stdout}]`);
|
|
100
|
+
data.forEach((disk) => {
|
|
101
|
+
const bsdName = disk.smartctl.argv[disk.smartctl.argv.length - 1];
|
|
102
|
+
for (let i = 0; i < result.length; i++) {
|
|
103
|
+
if (result[i].bsdName === bsdName) {
|
|
104
|
+
result[i].smartStatus = disk.smart_status.passed ? 'Ok' : disk.smart_status.passed === false ? 'Predicted Failure' : 'unknown';
|
|
105
|
+
if (disk.temperature && disk.temperature.current) {
|
|
106
|
+
result[i].temperature = disk.temperature.current;
|
|
107
|
+
}
|
|
108
|
+
result[i].smartData = disk;
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
cmd = '';
|
|
113
|
+
}
|
|
114
|
+
catch { }
|
|
115
|
+
if (cmd) {
|
|
116
|
+
cmd = cmd + 'printf "\n"';
|
|
117
|
+
try {
|
|
118
|
+
({ stdout } = await (0, exec_1.exec)(cmd, const_1.execOptsLinux));
|
|
119
|
+
const lines = stdout.split('\n');
|
|
120
|
+
lines.forEach((line) => {
|
|
121
|
+
if (line) {
|
|
122
|
+
const parts = line.split('|');
|
|
123
|
+
if (parts.length === 2) {
|
|
124
|
+
const bsdName = parts[0];
|
|
125
|
+
parts[1] = parts[1].trim();
|
|
126
|
+
const parts2 = parts[1].split(':');
|
|
127
|
+
if (parts2.length === 2) {
|
|
128
|
+
parts2[1] = parts2[1].trim();
|
|
129
|
+
const status = parts2[1].toLowerCase();
|
|
130
|
+
for (let i = 0; i < result.length; i++) {
|
|
131
|
+
if (result[i].bsdName === bsdName) {
|
|
132
|
+
result[i].smartStatus = status === 'passed' ? 'Ok' : status === 'failed!' ? 'Predicted Failure' : 'unknown';
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
catch { }
|
|
141
|
+
}
|
|
142
|
+
for (let i = 0; i < result.length; i++) {
|
|
143
|
+
delete result[i].bsdName;
|
|
144
|
+
}
|
|
145
|
+
return result;
|
|
146
|
+
}
|
|
147
|
+
catch {
|
|
148
|
+
return [];
|
|
149
|
+
}
|
|
150
|
+
};
|
|
151
|
+
exports.diskLayout = diskLayout;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.disksIO = void 0;
|
|
4
|
+
const defaults_1 = require("../common/defaults");
|
|
5
|
+
const index_1 = require("../common/index");
|
|
6
|
+
const exec_1 = require("../common/exec");
|
|
7
|
+
const common_1 = require("../common");
|
|
8
|
+
const filesys_1 = require("../common/filesys");
|
|
9
|
+
const const_1 = require("../common/const");
|
|
10
|
+
const disksIO = async () => {
|
|
11
|
+
await (0, common_1.nextTick)();
|
|
12
|
+
if ((filesys_1._disk_io && !filesys_1._disk_io.ms) || (filesys_1._disk_io && filesys_1._disk_io.ms && Date.now() - filesys_1._disk_io.ms >= 500)) {
|
|
13
|
+
const defaults = (0, index_1.cloneObj)(defaults_1.initDiskIo);
|
|
14
|
+
let rIO = 0;
|
|
15
|
+
let wIO = 0;
|
|
16
|
+
let rWaitTime = 0;
|
|
17
|
+
let wWaitTime = 0;
|
|
18
|
+
let tWaitTime = 0;
|
|
19
|
+
try {
|
|
20
|
+
const cmd = 'for mount in `lsblk 2>/dev/null | grep " disk " | sed "s/[│└─├]//g" | awk \'{$1=$1};1\' | cut -d " " -f 1 | sort -u`; do cat /sys/block/$mount/stat | sed -r "s/ +/;/g" | sed -r "s/^;//"; done';
|
|
21
|
+
const { stdout } = await (0, exec_1.exec)(cmd, const_1.execOptsLinux);
|
|
22
|
+
const lines = stdout.split('\n');
|
|
23
|
+
lines.forEach(function (line) {
|
|
24
|
+
if (!line) {
|
|
25
|
+
return;
|
|
26
|
+
}
|
|
27
|
+
const stats = line.split(';');
|
|
28
|
+
rIO += (0, common_1.toInt)(stats[0]);
|
|
29
|
+
wIO += (0, common_1.toInt)(stats[4]);
|
|
30
|
+
rWaitTime += (0, common_1.toInt)(stats[3]);
|
|
31
|
+
wWaitTime += (0, common_1.toInt)(stats[7]);
|
|
32
|
+
tWaitTime += (0, common_1.toInt)(stats[10]);
|
|
33
|
+
});
|
|
34
|
+
return (0, filesys_1.calcDiskIO)(rIO, wIO, rWaitTime, wWaitTime, tWaitTime);
|
|
35
|
+
}
|
|
36
|
+
catch {
|
|
37
|
+
return defaults;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
return {
|
|
42
|
+
rIO: filesys_1._disk_io.rIO,
|
|
43
|
+
wIO: filesys_1._disk_io.wIO,
|
|
44
|
+
tIO: filesys_1._disk_io.rIO + filesys_1._disk_io.wIO,
|
|
45
|
+
ms: filesys_1._disk_io.last_ms,
|
|
46
|
+
rIO_sec: filesys_1._disk_io.rIO_sec,
|
|
47
|
+
wIO_sec: filesys_1._disk_io.wIO_sec,
|
|
48
|
+
tIO_sec: filesys_1._disk_io.tIO_sec,
|
|
49
|
+
rWaitTime: filesys_1._disk_io.rWaitTime,
|
|
50
|
+
wWaitTime: filesys_1._disk_io.wWaitTime,
|
|
51
|
+
tWaitTime: filesys_1._disk_io.tWaitTime,
|
|
52
|
+
rWaitPercent: filesys_1._disk_io.rWaitPercent,
|
|
53
|
+
wWaitPercent: filesys_1._disk_io.wWaitPercent,
|
|
54
|
+
tWaitPercent: filesys_1._disk_io.tWaitPercent
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
exports.disksIO = disksIO;
|