mirror of
https://github.com/Ylianst/MeshAgent
synced 2025-12-18 01:03:14 +00:00
First commit of MeshAgent for MeshCentral
This commit is contained in:
19
Debug/NetworkMonitorTest.js
Normal file
19
Debug/NetworkMonitorTest.js
Normal file
@@ -0,0 +1,19 @@
|
||||
var nm = require('NetworkMonitor');
|
||||
nm.on('change', function () { console.log("Change detected..."); });
|
||||
nm.on('add', function (addr) { console.log("Address (" + addr + ") added"); });
|
||||
nm.on('remove', function (addr) { console.log("Address (" + addr + ") removed"); });
|
||||
|
||||
console.log("Started Test");
|
||||
|
||||
function OnChange()
|
||||
{
|
||||
var interfaces = require('os').networkInterfaces();
|
||||
for(var key in interfaces)
|
||||
{
|
||||
for (var i in interfaces[key])
|
||||
{
|
||||
console.log("Address ==> " + interfaces[key][i].address);
|
||||
console.log(" status ==> " + interfaces[key][i].status);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user