1
0
Fork 0
mirror of https://github.com/Ylianst/MeshCentral.git synced 2025-03-09 15:40:18 +00:00

Added windows thermals

This commit is contained in:
Bryan Roe 2021-01-20 14:38:04 -08:00
parent be81ba9518
commit 78f48a7692
3 changed files with 72 additions and 14 deletions

View file

@ -1001,7 +1001,19 @@ function createMeshCore(agent) {
var cpuuse = require('sysinfo').cpuUtilization();
cpuuse.sessionid = data.sessionid;
cpuuse.tag = data.tag;
cpuuse.then(function (data) { mesh.SendCommand(JSON.stringify({ action: 'msg', type: 'cpuinfo', cpu: data, memory: require('sysinfo').memUtilization(), sessionid: this.sessionid, tag: this.tag })); }, function (ex) { });
cpuuse.then(function (data)
{
mesh.SendCommand(JSON.stringify(
{
action: 'msg',
type: 'cpuinfo',
cpu: data,
memory: require('sysinfo').memUtilization(),
thermals: require('sysinfo').thermals==null?[]:require('sysinfo').thermals(),
sessionid: this.sessionid,
tag: this.tag
}));
}, function (ex) { });
break;
case 'localapp':
// Send a message to a local application
@ -3266,8 +3278,14 @@ function createMeshCore(agent) {
// CPU & memory utilization
pr = require('sysinfo').cpuUtilization();
pr.sessionid = sessionid;
pr.then(function (data) {
sendConsoleText(JSON.stringify({ cpu: data, memory: require('sysinfo').memUtilization() }, null, 1), this.sessionid);
pr.then(function (data)
{
sendConsoleText(JSON.stringify(
{
cpu: data,
memory: require('sysinfo').memUtilization(),
thermals: require('sysinfo').thermals == null ? [] : require('sysinfo').thermals()
}, null, 1), this.sessionid);
}, function (e) {
sendConsoleText(e);
});