Code Monkey home page Code Monkey logo

Comments (4)

lorenwest avatar lorenwest commented on July 21, 2024

processMonitor is a reference to a remote probe, written for the purpose of monitoring the process aspects of a remote server. You could write your own probe, say, temperatureMonitor, and that probe could contain the temperature of the remote server.

So the answer to your question - the probe running on the remote server defines the data in the JSON object. Change the probe, and you'll change the data in that object. You could change one of the existing probes, extend it, or write a probe for yourself.

Good luck!

from node-monitor.

JohnPekl avatar JohnPekl commented on July 21, 2024

Please give me an example of a Probe. (For example: http://lorenwest.github.io/node-monitor/doc/classes/Probe.html).

Whenever I use ping_control()/onControl, it has an error: ping_control/onControl is not a function.

Thank for your help.

from node-monitor.

lorenwest avatar lorenwest commented on July 21, 2024

The left hand panel of the Probe.html page has a list of many different examples of probes. The documentation connects directly with the code so you can see how working probes are built.

Here's an example of a few probes on a dashboard: http://lorenwest.github.io/monitor-dashboard/pages/overview/dashboards.html

I can't provide consulting, so I hope these examples provide enough guidance.

from node-monitor.

JohnPekl avatar JohnPekl commented on July 21, 2024

I have spent two days on what you told me, but it is difficult to understand the Probe.
Whenever I run a server, It appears an error [2017-02-21T06:31:29.106Z] [ERROR] Monitor.control.Process.ping - Probe not connected

Monitor App:

var Monitor = require('monitor');
var LOW_MEMORY_THRESHOLD = 100000000;
// Set the probe to push changes every 10 seconds
var options = {
hostName: '192.168.1.70',
probeClass: 'Process',
initParams: {
pollInterval: 10000
}
}
var processMonitor = new Monitor(options);
// Attach the change listener
processMonitor.on('change', function() {
});
// Now connect the monitor
processMonitor.connect(function(error) {
if (error) {
console.error('Error connecting with the process probe: ', error);
process.exit(1);
}
});
// Remote control
processMonitor.control('ping', function(error, response) {
console.log('Ping response: ', response);
});

Server to be monitored:
var Monitor = require('monitor');
var serverMon = new Monitor.Server(options);
serverMon.on('start', function() {
console.log("Server Started...");
});
var options = {
probeClass: 'Process',
initParams: {
pollInterval: 10000
}
}
var Probe = new Monitor.Probe(options);
Probe.ping_control('ping',function(error, content) {
console.log("ping_control: " + content + ', ' + error);
});
//Probe.start();
//console.log(this.probe.get('probeClass'));
serverMon.start();

How to connect probes?
Please help me out!!

from node-monitor.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.