host-monitor
v0.9.23
Published
node.js tool for host status monitoring
Downloads
6
Readme
host-monitor
node.js tool for host status monitoring
Install
$ npm install host-monitor
Usage
By default monitor will check host availability each 30 mins
Register host
monitor will start to check host constantly right after registration
monitor.register(host, onUpFunction, onDonwFunction);
Example:
var monitor = require("host-monitor");
var onUp = function () {
console.log("Host is UP");
};
var onDown = function () {
console.log("Host is DOWN");
}
monitor.register("127.0.0.1:8080", onUp, onDown);
Config
You can override monitor's default config.
To check current available options use:
monitor.config();
To override option use:
monitor.config({
defaultInterval: 5000
})
It will force monitor to check host availability each 5 seconds
Remove
You can remove host from monitor by:
monitor.remove(hostName);
Get
If you need some extra manipulations with monitor object you can get Instance by:
monitor.get(hostName);
check Instance.js for additional info about Instance methods