comlog-system-monitor
v0.9.2
Published
Service monitoring
Downloads
64
Maintainers
Readme
System monitoring software
Installation local
$ npm install comlog-system-monitor
Installation global
$ npm install -g comlog-system-monitor
$ comlog-system-monitor /path/to/config.json/if/not/in/working/directory
Installation of needed modules
$ npm install -s comlog-system-monitor-filetime
Usage
- Rename config.example.json or config.example.js and configure them.
- Remove all the blocks you do not need.
- Start node bin/run.js (or run comlog-system-monitor if global installed)
Integration
// Disable ssl check if you need it
process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";
var CSM = new (require('./comlog-system-monitor.js'))();
// Add a watcher service
CSM.addWatcher({
"name": "Processlog",
"interval": 10000,
"type": "filetime",
"timeout": 60000,
"debug": true,
"path": "function() {\n\tvar path = process.env.TEMP;\n\n\tpath += '\\\\process.log'\nreturn path;}",
"on": {
"down": [
{
"type": "email",
"to": "[email protected]"
}
],
"up": [
{
"type": "email",
"to": "[email protected]"
}
]
}
});
// Global action configuration (./actions folder)
CSM.addActionSettings('email', {
"host": "smtp.mydomain.de",
"user": "noreply",
"password": "Password",
"ssl": false,
"tls": true
});
// Define on error event
CSM.on('error', function (err) {
console.error(err.stack || err+'');
});
// Start monitoring
CSM.start();