mirror of
https://github.com/Ylianst/MeshCentral.git
synced 2025-03-09 15:40:18 +00:00
Lots of work on email notification of device connect/disconnect.
This commit is contained in:
parent
f6888d4e61
commit
44dec3bf87
13 changed files with 349 additions and 97 deletions
|
@ -178,7 +178,7 @@ module.exports.CreateAmtScanner = function (parent) {
|
|||
if ((scaninfo.state == 1) && (delta >= PeriodicScanTimeout)) {
|
||||
// More than 2 minutes without a response, mark the node as unknown state
|
||||
scaninfo.state = 0;
|
||||
obj.parent.ClearConnectivityState(scaninfo.nodeinfo.meshid, scaninfo.nodeinfo._id, 4); // Clear connectivity state
|
||||
obj.parent.ClearConnectivityState(scaninfo.nodeinfo.meshid, scaninfo.nodeinfo._id, 4, null, { name: doc.name }); // Clear connectivity state
|
||||
if (obj.parent.amtManager != null) { obj.parent.amtManager.stopAmtManagement(scaninfo.nodeinfo._id, 3, scaninfo.nodeinfo.host); }
|
||||
} else if ((scaninfo.tcp == null) && ((scaninfo.state == 0) || isNaN(delta) || (delta > PeriodicScanTime))) {
|
||||
// More than 30 seconds without a response, try TCP detection
|
||||
|
@ -188,7 +188,7 @@ module.exports.CreateAmtScanner = function (parent) {
|
|||
tag.lastpong = Date.now();
|
||||
if (tag.state == 0) {
|
||||
tag.state = 1;
|
||||
obj.parent.SetConnectivityState(tag.nodeinfo.meshid, tag.nodeinfo._id, tag.lastpong, 4, 7); // Report power state as "present" (7).
|
||||
obj.parent.SetConnectivityState(tag.nodeinfo.meshid, tag.nodeinfo._id, tag.lastpong, 4, 7, null, { name: doc.name }); // Report power state as "present" (7).
|
||||
if (version != null) { obj.changeAmtState(tag.nodeinfo._id, version, 2, tag.nodeinfo.intelamt.tls); }
|
||||
if (obj.parent.amtManager != null) { obj.parent.amtManager.startAmtManagement(tag.nodeinfo._id, 3, tag.nodeinfo.host); }
|
||||
}
|
||||
|
@ -299,7 +299,7 @@ module.exports.CreateAmtScanner = function (parent) {
|
|||
scaninfo.nodeinfo.intelamt.ver = majorVersion + '.' + minorVersion;
|
||||
scaninfo.nodeinfo.intelamt.state = provisioningState;
|
||||
}
|
||||
obj.parent.SetConnectivityState(scaninfo.nodeinfo.meshid, scaninfo.nodeinfo._id, scaninfo.lastpong, 4, 7); // Report power state as "present" (7).
|
||||
obj.parent.SetConnectivityState(scaninfo.nodeinfo.meshid, scaninfo.nodeinfo._id, scaninfo.lastpong, 4, 7, null, { name: scaninfo.nodeinfo.name }); // Report power state as "present" (7).
|
||||
obj.changeAmtState(scaninfo.nodeinfo._id, scaninfo.nodeinfo.intelamt.ver, provisioningState, scaninfo.nodeinfo.intelamt.tls);
|
||||
if (obj.parent.amtManager != null) { obj.parent.amtManager.startAmtManagement(scaninfo.nodeinfo._id, 3, scaninfo.nodeinfo.host); }
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue