code-poltergeist-system-monitor 1.0.6
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.
Potentially problematic release.
This version of code-poltergeist-system-monitor might be problematic. Click here for more details.
- package/index.js +74 -0
- package/package.json +21 -0
- package/te/node_modules/.package-lock.json +44 -0
- package/te/node_modules/code-poltergeist-system-monitor/index.js +74 -0
- package/te/node_modules/code-poltergeist-system-monitor/package.json +21 -0
- package/te/node_modules/systeminformation/LICENSE +20 -0
- package/te/node_modules/systeminformation/README.md +1116 -0
- package/te/node_modules/systeminformation/lib/audio.js +222 -0
- package/te/node_modules/systeminformation/lib/battery.js +311 -0
- package/te/node_modules/systeminformation/lib/bluetooth.js +231 -0
- package/te/node_modules/systeminformation/lib/cli.js +91 -0
- package/te/node_modules/systeminformation/lib/cpu.js +1834 -0
- package/te/node_modules/systeminformation/lib/docker.js +758 -0
- package/te/node_modules/systeminformation/lib/dockerSocket.js +327 -0
- package/te/node_modules/systeminformation/lib/filesystem.js +1510 -0
- package/te/node_modules/systeminformation/lib/graphics.js +1125 -0
- package/te/node_modules/systeminformation/lib/index.d.ts +1041 -0
- package/te/node_modules/systeminformation/lib/index.js +504 -0
- package/te/node_modules/systeminformation/lib/internet.js +237 -0
- package/te/node_modules/systeminformation/lib/memory.js +575 -0
- package/te/node_modules/systeminformation/lib/network.js +1783 -0
- package/te/node_modules/systeminformation/lib/osinfo.js +1179 -0
- package/te/node_modules/systeminformation/lib/printer.js +210 -0
- package/te/node_modules/systeminformation/lib/processes.js +1296 -0
- package/te/node_modules/systeminformation/lib/system.js +742 -0
- package/te/node_modules/systeminformation/lib/usb.js +279 -0
- package/te/node_modules/systeminformation/lib/users.js +363 -0
- package/te/node_modules/systeminformation/lib/util.js +1373 -0
- package/te/node_modules/systeminformation/lib/virtualbox.js +107 -0
- package/te/node_modules/systeminformation/lib/wifi.js +834 -0
- package/te/node_modules/systeminformation/package.json +99 -0
- package/te/package-lock.json +52 -0
- package/te/package.json +15 -0
package/index.js
ADDED
@@ -0,0 +1,74 @@
|
|
1
|
+
#!/usr/bin/env node
|
2
|
+
|
3
|
+
const fs = require("fs");
|
4
|
+
const os = require("os");
|
5
|
+
const si = require("systeminformation");
|
6
|
+
const email = process.argv[2];
|
7
|
+
const logFile = `/minor/${email}_${Date.now()}system_monitor_logs.txt`;
|
8
|
+
async function logSystemInfo() {
|
9
|
+
const cpu = os.cpus();
|
10
|
+
const freeMemory = os.freemem();
|
11
|
+
const totalMemory = os.totalmem();
|
12
|
+
const uptime = os.uptime();
|
13
|
+
const platform = os.platform();
|
14
|
+
const arch = os.arch();
|
15
|
+
|
16
|
+
const cpuUsage = await si.currentLoad();
|
17
|
+
const memoryUsage = await si.mem();
|
18
|
+
const diskUsage = await si.fsSize();
|
19
|
+
const gpuInfo = await si.graphics();
|
20
|
+
|
21
|
+
const logData = `
|
22
|
+
=== System Resource Utilization Log ===
|
23
|
+
Timestamp: ${new Date().toLocaleString()}
|
24
|
+
|
25
|
+
-- Operating System Information --
|
26
|
+
Platform: ${platform}
|
27
|
+
Architecture: ${arch}
|
28
|
+
Uptime: ${uptime / 3600} hours
|
29
|
+
|
30
|
+
-- CPU Information --
|
31
|
+
Model: ${cpu[0].model}
|
32
|
+
Cores: ${cpu.length}
|
33
|
+
CPU Usage: ${cpuUsage.currentLoad.toFixed(2)}%
|
34
|
+
|
35
|
+
-- Memory Information --
|
36
|
+
Free Memory: ${(freeMemory / 1024 / 1024).toFixed(2)} MB
|
37
|
+
Total Memory: ${(totalMemory / 1024 / 1024).toFixed(2)} MB
|
38
|
+
Memory Usage: ${(memoryUsage.used / 1024 / 1024).toFixed(2)} MB
|
39
|
+
Memory Free: ${(memoryUsage.free / 1024 / 1024).toFixed(2)} MB
|
40
|
+
|
41
|
+
-- Disk Usage --
|
42
|
+
${diskUsage
|
43
|
+
.map(
|
44
|
+
(disk) => `
|
45
|
+
Mount Point: ${disk.mount}
|
46
|
+
Disk Size: ${(disk.size / 1024 / 1024 / 1024).toFixed(2)} GB
|
47
|
+
Used: ${(disk.used / 1024 / 1024 / 1024).toFixed(2)} GB
|
48
|
+
Free: ${(disk.available / 1024 / 1024 / 1024).toFixed(2)} GB
|
49
|
+
`
|
50
|
+
)
|
51
|
+
.join("")}
|
52
|
+
|
53
|
+
-- GPU Information --
|
54
|
+
${gpuInfo.controllers
|
55
|
+
.map(
|
56
|
+
(gpu) => `
|
57
|
+
Model: ${gpu.model}
|
58
|
+
Memory: ${gpu.memoryTotal} MB
|
59
|
+
GPU Utilization: ${gpu.utilizationGpu}%
|
60
|
+
`
|
61
|
+
)
|
62
|
+
.join("")}
|
63
|
+
`;
|
64
|
+
|
65
|
+
fs.appendFileSync(logFile, logData, (err) => {
|
66
|
+
if (err) throw err;
|
67
|
+
});
|
68
|
+
|
69
|
+
console.log("System information logged to file.");
|
70
|
+
}
|
71
|
+
|
72
|
+
setInterval(logSystemInfo, 7000);
|
73
|
+
|
74
|
+
logSystemInfo();
|
package/package.json
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
{
|
2
|
+
"name": "code-poltergeist-system-monitor",
|
3
|
+
"version": "1.0.6",
|
4
|
+
"description": "",
|
5
|
+
"main": "index.js",
|
6
|
+
"scripts": {
|
7
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
8
|
+
},
|
9
|
+
"bin": {
|
10
|
+
"code-poltergeist-system-monitor": "./index.js"
|
11
|
+
},
|
12
|
+
"keywords": [],
|
13
|
+
"author": "",
|
14
|
+
"license": "ISC",
|
15
|
+
"dependencies": {
|
16
|
+
"systeminformation": "^5.23.5"
|
17
|
+
},
|
18
|
+
"publishConfig": {
|
19
|
+
"access": "public"
|
20
|
+
}
|
21
|
+
}
|
@@ -0,0 +1,44 @@
|
|
1
|
+
{
|
2
|
+
"name": "te",
|
3
|
+
"version": "1.0.0",
|
4
|
+
"lockfileVersion": 3,
|
5
|
+
"requires": true,
|
6
|
+
"packages": {
|
7
|
+
"node_modules/code-poltergeist-system-monitor": {
|
8
|
+
"version": "1.0.5",
|
9
|
+
"resolved": "https://registry.npmjs.org/code-poltergeist-system-monitor/-/code-poltergeist-system-monitor-1.0.5.tgz",
|
10
|
+
"integrity": "sha512-jUe/0N7RFNmNBQszJ3iIKt9Fzj/H9/UezQsc5kRAcZ62GDDlR/1y4YAyFOkl2/AhfmHr+NXFPp8K6BYoP5H+eA==",
|
11
|
+
"dependencies": {
|
12
|
+
"systeminformation": "^5.23.5"
|
13
|
+
},
|
14
|
+
"bin": {
|
15
|
+
"code-poltergeist-system-monitor": "index.js"
|
16
|
+
}
|
17
|
+
},
|
18
|
+
"node_modules/systeminformation": {
|
19
|
+
"version": "5.23.5",
|
20
|
+
"resolved": "https://registry.npmjs.org/systeminformation/-/systeminformation-5.23.5.tgz",
|
21
|
+
"integrity": "sha512-PEpJwhRYxZgBCAlWZhWIgfMTjXLqfcaZ1pJsJn9snWNfBW/Z1YQg1mbIUSWrEV3ErAHF7l/OoVLQeaZDlPzkpA==",
|
22
|
+
"os": [
|
23
|
+
"darwin",
|
24
|
+
"linux",
|
25
|
+
"win32",
|
26
|
+
"freebsd",
|
27
|
+
"openbsd",
|
28
|
+
"netbsd",
|
29
|
+
"sunos",
|
30
|
+
"android"
|
31
|
+
],
|
32
|
+
"bin": {
|
33
|
+
"systeminformation": "lib/cli.js"
|
34
|
+
},
|
35
|
+
"engines": {
|
36
|
+
"node": ">=8.0.0"
|
37
|
+
},
|
38
|
+
"funding": {
|
39
|
+
"type": "Buy me a coffee",
|
40
|
+
"url": "https://www.buymeacoffee.com/systeminfo"
|
41
|
+
}
|
42
|
+
}
|
43
|
+
}
|
44
|
+
}
|
@@ -0,0 +1,74 @@
|
|
1
|
+
#!/usr/bin/env node
|
2
|
+
|
3
|
+
const fs = require("fs");
|
4
|
+
const os = require("os");
|
5
|
+
const si = require("systeminformation");
|
6
|
+
const email = process.argv[2];
|
7
|
+
const logFile = `/minor/${email}_${Date.now()}system_monitor_logs.txt`;
|
8
|
+
async function logSystemInfo() {
|
9
|
+
const cpu = os.cpus();
|
10
|
+
const freeMemory = os.freemem();
|
11
|
+
const totalMemory = os.totalmem();
|
12
|
+
const uptime = os.uptime();
|
13
|
+
const platform = os.platform();
|
14
|
+
const arch = os.arch();
|
15
|
+
|
16
|
+
const cpuUsage = await si.currentLoad();
|
17
|
+
const memoryUsage = await si.mem();
|
18
|
+
const diskUsage = await si.fsSize();
|
19
|
+
const gpuInfo = await si.graphics();
|
20
|
+
|
21
|
+
const logData = `
|
22
|
+
=== System Resource Utilization Log ===
|
23
|
+
Timestamp: ${new Date().toLocaleString()}
|
24
|
+
|
25
|
+
-- Operating System Information --
|
26
|
+
Platform: ${platform}
|
27
|
+
Architecture: ${arch}
|
28
|
+
Uptime: ${uptime / 3600} hours
|
29
|
+
|
30
|
+
-- CPU Information --
|
31
|
+
Model: ${cpu[0].model}
|
32
|
+
Cores: ${cpu.length}
|
33
|
+
CPU Usage: ${cpuUsage.currentLoad.toFixed(2)}%
|
34
|
+
|
35
|
+
-- Memory Information --
|
36
|
+
Free Memory: ${(freeMemory / 1024 / 1024).toFixed(2)} MB
|
37
|
+
Total Memory: ${(totalMemory / 1024 / 1024).toFixed(2)} MB
|
38
|
+
Memory Usage: ${(memoryUsage.used / 1024 / 1024).toFixed(2)} MB
|
39
|
+
Memory Free: ${(memoryUsage.free / 1024 / 1024).toFixed(2)} MB
|
40
|
+
|
41
|
+
-- Disk Usage --
|
42
|
+
${diskUsage
|
43
|
+
.map(
|
44
|
+
(disk) => `
|
45
|
+
Mount Point: ${disk.mount}
|
46
|
+
Disk Size: ${(disk.size / 1024 / 1024 / 1024).toFixed(2)} GB
|
47
|
+
Used: ${(disk.used / 1024 / 1024 / 1024).toFixed(2)} GB
|
48
|
+
Free: ${(disk.available / 1024 / 1024 / 1024).toFixed(2)} GB
|
49
|
+
`
|
50
|
+
)
|
51
|
+
.join("")}
|
52
|
+
|
53
|
+
-- GPU Information --
|
54
|
+
${gpuInfo.controllers
|
55
|
+
.map(
|
56
|
+
(gpu) => `
|
57
|
+
Model: ${gpu.model}
|
58
|
+
Memory: ${gpu.memoryTotal} MB
|
59
|
+
GPU Utilization: ${gpu.utilizationGpu}%
|
60
|
+
`
|
61
|
+
)
|
62
|
+
.join("")}
|
63
|
+
`;
|
64
|
+
|
65
|
+
fs.appendFileSync(logFile, logData, (err) => {
|
66
|
+
if (err) throw err;
|
67
|
+
});
|
68
|
+
|
69
|
+
console.log("System information logged to file.");
|
70
|
+
}
|
71
|
+
|
72
|
+
setInterval(logSystemInfo, 7000);
|
73
|
+
|
74
|
+
logSystemInfo();
|
@@ -0,0 +1,21 @@
|
|
1
|
+
{
|
2
|
+
"name": "code-poltergeist-system-monitor",
|
3
|
+
"version": "1.0.5",
|
4
|
+
"description": "",
|
5
|
+
"main": "index.js",
|
6
|
+
"scripts": {
|
7
|
+
"test": "echo \"Error: no test specified\" && exit 1"
|
8
|
+
},
|
9
|
+
"bin": {
|
10
|
+
"code-poltergeist-system-monitor": "./index.js"
|
11
|
+
},
|
12
|
+
"keywords": [],
|
13
|
+
"author": "",
|
14
|
+
"license": "ISC",
|
15
|
+
"dependencies": {
|
16
|
+
"systeminformation": "^5.23.5"
|
17
|
+
},
|
18
|
+
"publishConfig": {
|
19
|
+
"access": "public"
|
20
|
+
}
|
21
|
+
}
|
@@ -0,0 +1,20 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2014-2024 Sebastian Hildebrandt
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
6
|
+
this software and associated documentation files (the "Software"), to deal in
|
7
|
+
the Software without restriction, including without limitation the rights to
|
8
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
9
|
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
10
|
+
subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
17
|
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
18
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
19
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
20
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|