UNPKG

elasticsearch-watchdog

Version:

A watchdog of elasticsearch - cluster nodes' statuses monitor, auto restart, keep PRIMARY node unique.

21 lines (18 loc) 481 B
var Watchdog = require('../'), path = require('path'); // load configuration. var monit = Watchdog({ conf: path.join(__dirname, 'confs', (process.argv.length == 3 ? process.argv[2] : 'local') + '.yml'), uid : false }); // listen events. monit.on('info', function(msg){ console[msg.type]((new Date()).toISOString() + ':', msg.message); }); // start watching. monit.watching(); // end it. setTimeout(function(){ console.log('End monitor'); monit.end(); }, 5000);