loop-monitoring

0.0.3 • Public • Published

Loop Monitoring

Loop Monitoring is a libs for checking your service is up or down using cronjob and store the report to your MongoDB Database.

Installation

Make sure you have NODE and MONGODB.

npm install loop-monitoring

How EXAMPLE

var LoopMonitoring = require('loop-monitoring');

var listService = require('./exampleData.json');
var cronScheduler = "*/2 * * * * *";
var mongoUrl = 'mongodb://localhost/monitoring';


var monitoring = new LoopMonitoring(listService,cronScheduler,mongoUrl)

monitoring.Start();

console.log(`
  Monitoring Start
`)

Example list of services

Create a json with key serviceName and serviceUrl

[
	{
		"serviceName":"Service 1",
		"serviceUrl":"http://localhost:8080"
	},
	{
		"serviceName":"Service 2",
		"serviceUrl":"http://localhost:9807"
	},
	{
		"serviceName":"Service 3",
		"serviceUrl":"http://localhost:4500"
	},
	{
		"serviceName":"Service 4",
		"serviceUrl":"http://localhost:7787"
	},
	{
		"serviceName":"Service 5",
		"serviceUrl":"http://localhost:7966"
	}
]

Example Folder

You can try to run the code sample in example folder.

Contact

If you have any questions, feedback, idea or anything, please drop me a message at prima.yudantra@gmail.com

License

MIT Copyright © 2017 Prima Yudantra

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
0.0.33latest

Version History

VersionDownloads (Last 7 Days)Published
0.0.33
0.0.10

Package Sidebar

Install

npm i loop-monitoring

Weekly Downloads

3

Version

0.0.3

License

MIT

Last publish

Collaborators

  • primayudantra