Improved MeshCtrl deviceinfo
Ylian Saint-Hilaire committed
Aug 28, 2020 at 16:45 UTC
cf28d9c40b36e874b2cf24ecc6c9112b8c33d2b6
2 files changed
+25
-1
agents/meshagent_mips24kc
Binary files /dev/null and b/agents/meshagent_mips24kc differ
meshctrl.js
+25
-1
@@ -1483,6 +1483,30 @@ function displayDeviceInfo(sysinfo, lastconnect, network) {
1483
if (lastconnect != null) { node.lastconnect = lastconnect.time; node.lastaddr = lastconnect.addr; }
1484
if (args.raw) { console.log(JSON.stringify(sysinfo, ' ', 2)); return; }
1485
1486
+ // General
1487
+ var output = {}, outputCount = 0;
1488
+ if (node.rname) { output["Server Name"] = node.name; outputCount++; }
1489
+ if (node.host != null) { output["Hostname"] = node.host; outputCount++; }
1490
+ if (node.ip != null) { output["IP Address"] = node.ip; outputCount++; }
1491
+ if (node.desc != null) { output["Description"] = node.desc; outputCount++; }
1492
+ if (node.icon != null) { output["Icon"] = node.icon; outputCount++; }
1493
+ if (node.tags) { output["Tags"] = node.tags; outputCount++; }
1494
+ if (node.av) {
1495
+ var av = [];
1496
+ for (var i in node.av) {
1497
+ if (typeof node.av[i]['product'] == 'string') {
1498
+ var n = node.av[i]['product'];
1499
+ if (node.av[i]['updated'] === true) { n += ', updated'; }
1500
+ if (node.av[i]['updated'] === false) { n += ', not updated'; }
1501
+ if (node.av[i]['enabled'] === true) { n += ', enabled'; }
1502
+ if (node.av[i]['enabled'] === false) { n += ', disabled'; }
1503
+ av.push(n);
1504
+ }
1505
+ }
1506
+ output["AntiVirus"] = av; outputCount++;
1507
+ }
1508
+ if (outputCount > 0) { info["General"] = output; }
1509
+
1510
// Operating System
1511
if ((hardware.windows && hardware.windows.osinfo) || node.osdesc) {
1512
var output = {}, outputCount = 0;
@@ -1612,7 +1636,7 @@ function displayDeviceInfo(sysinfo, lastconnect, network) {
1636
for (var i in info) {
1637
console.log('--- ' + i + ' ---');
1638
for (var j in info[i]) {
1615
- if (typeof info[i][j] == 'string') {
1639
+ if ((typeof info[i][j] == 'string') || (typeof info[i][j] == 'number')) {
1640
console.log(' ' + j + ': ' + info[i][j]);
1641
} else {
1642
console.log(' ' + j + ':');