You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Though I received data from Server periodically, the function processMonitor.getConnection() return null.
Also, the function processMonitor.control('ping', function(error, response), return null due to the error [ERROR] Monitor.control.Process.ping - Probe not connected
server.js
`var Monitor = require('monitor');
var options = {
probeClass: 'Process',
initParams: {
pollInterval: 10000
}
}
var Probe = new Monitor.Probe(options);
Probe.onControl('ping', function(error, response) {
response = 'asdasdasd';//console.log('Ping response: ', response);
});
var server = new Monitor.Server();
server.start();`
client.js
`var options = {
hostName: '192.168.2.3',
probeClass: 'Process',
initParams: {
pollInterval: 10000
}
}
var Monitor = require('monitor');
// Connecting a monitor to a probe
var processMonitor = new Monitor(options);
processMonitor.connect(function(err) {console.log('aa', err);});
//var Connection = Monitor.Connection(options);
// Monitoring the probe
processMonitor.on('change', function(){
console.log('Changes:', processMonitor.get('freemem'));
});
I tried to run the example from here. (http://lorenwest.github.io/node-monitor/doc/classes/Monitor.html)
Though I received data from Server periodically, the function processMonitor.getConnection() return null.
Also, the function processMonitor.control('ping', function(error, response), return null due to the error [ERROR] Monitor.control.Process.ping - Probe not connected
server.js
`var Monitor = require('monitor');
var options = {
probeClass: 'Process',
initParams: {
pollInterval: 10000
}
}
var Probe = new Monitor.Probe(options);
Probe.onControl('ping', function(error, response) {
response = 'asdasdasd';//console.log('Ping response: ', response);
});
var server = new Monitor.Server();
server.start();`
client.js
`var options = {
hostName: '192.168.2.3',
probeClass: 'Process',
initParams: {
pollInterval: 10000
}
}
var Monitor = require('monitor');
// Connecting a monitor to a probe
var processMonitor = new Monitor(options);
processMonitor.connect(function(err) {console.log('aa', err);});
//var Connection = Monitor.Connection(options);
// Monitoring the probe
processMonitor.on('change', function(){
console.log('Changes:', processMonitor.get('freemem'));
});
// Remote control
processMonitor.control('ping', function(error, response) {
console.log('Ping response: ', response);
});
console.log('getConnection()', processMonitor.getConnection());`
The text was updated successfully, but these errors were encountered: