• Stars
    star
    109
  • Rank 319,077 (Top 7 %)
  • Language
    JavaScript
  • Created over 10 years ago
  • Updated almost 10 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Health monitoring of HTTP services and databases.

Heartbeat

Health monitoring of HTTP services and databases.

Requirements

You decide what to use for notifications, Mandrill (emails), Twilio (sms) or both.

How to use

Clone the repo and install dependenices,

$ git clone git://github.com/likeastore/heartbeat
$ cd heartbeat
$ npm install

Create index.js in /config folder,

module.exports = {
	connection: 'mongodb://localhost:27017/heartbeatdb',

	interval: 10000,

	logentries: {
		token: null
	},

	monitor: {
		http: [
			{
				url: 'https://likeastorea.com'
			},
			{
				url: 'https://stage.likeastore.com'
			}
		],

		json: [
			{
				url: 'https://app.likeastore.com/api/monitor',
				response: {
					"app":"app.likeastore.com",
					"env":"production",
					"version":"0.0.52",
					"apiUrl":"/api"
				}
			}
		],

		mongo: [
			{
				connection: 'mongodb://localhost:27017/likeastoredb',
				collections: ['users'],
				query: function (db, callback) {
					db.users.findOne({email: '[email protected]'}, callback);
				}
			}
		],

		resolve: [
			{
				name: 'google.com'
			}
		],

		ping: [
			{
				ip: '37.139.9.95'
			}
		]
	},

	// notification options
	notify: {
		email: {
			from: '[email protected]',
			to: ['[email protected]']
		},

		sms: {
			to: ['+3805551211', '+3805551212']
		}
	},

	transport: {
		mandrill: {
			token: 'fake-token'
		},

		twilio: {
			sid: 'fake-sid',
			token: 'fake-token'
		}
	}
};

Start heart beating,

$ node app.js

API

Connection

Connection string to MongoDB to store heartbeat results.

connection: 'mongodb://localhost:27017/heartbeatdb',

Interval

The period of time between heartbeats,

interval: 5000

Monitor

Monitoring options. There are few strategies of heartbeating implemented now.

HTTP

HTTP/HTTPS requests, measure the request execution time and compare to !== 200 response code.

http: [
	{
		url: 'https://likeastore.com'
	},
	{
		url: 'https://stage.likeastore.com'
	}
]

JSON

HTTP/HTTPS requests for JSON API's.

json: [
	{
		url: 'https://app.likeastore.com/api/monitor',
		response: {
			"app":"app.likeastore.com",
			"env":"production",
			"version":"0.0.52",
			"apiUrl":"/api"
		}
	}
],

MongoDB

For MongoDB checking, to run any query:

mongo: [
	{
		connection: 'mongodb://localhost:27017/likeastoredb',
		collections: ['users'],
		query: function (db, callback) {
			db.users.findOne({email: '[email protected]'}, callback);
		}
	}
]

Resolve

Resolves given dns name into ip addresses and pings each address.

resolve: [
	{
		name: 'google.com'
	}
]

Ping

Pings given ip address.

ping: [
	{
		ip: '37.139.9.95'
	}
]

Planned

Transport

To be able to send and receive emails and sms, mandrill and twilio accounts have to be setup.

Mandril token

Mandrill access token,

mandrill: {
	token: "mandrill_access_token"
},

Twilio token

Twilio access token,

twilio: {
	sid: "twilio_sid",
	token: "twilio_access_token"
}

License (MIT)

Copyright (c) 2014, Likeastore.com [email protected]

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

More Repositories

1

ngDialog

Modals and popups provider for Angular.js applications
JavaScript
3,145
star
2

notifier

Fast to config, easy to to deploy notification server
JavaScript
127
star
3

maintenance

Express.js middleware for easy switching the app to maintenance mode.
JavaScript
111
star
4

elaster

MongoDB collection to Elastic Search index exporter
JavaScript
99
star
5

browser-extension

Augments Google search results with search from your likes.
JavaScript
45
star
6

app

HTTP API and Web Client of awesome Likeastore application.
JavaScript
32
star
7

dokku-pm2

Dokku plugin to utilize the power of pm2
Shell
26
star
8

likeastore-icons-pack

https://likeastore.com free social icons pack
20
star
9

collector

Data synchronization engine of Likeastore
JavaScript
18
star
10

ngCustomerVoice

Angular.js client provider for sending support emails
CSS
16
star
11

jobber

I run jobs to help Likeastore be a greatest service.
JavaScript
12
star
12

dashboard

Analytics dashboard powered by Seismo
JavaScript
10
star
13

emails

Emails services for Likeastore.
JavaScript
7
star
14

elastic-proxy

HTTP proxy for ElasticSearch cluster with simple auth
JavaScript
7
star
15

tracker

I track link clicks. That's it.
JavaScript
6
star
16

slick-grid-demo

New UI suggestion for likeastore app dashboard.
CSS
6
star
17

goodbye-letter

It's time to say goodbye to Likeastore app
HTML
5
star
18

analytics

Likeastore analytics server powered by Seismo.
JavaScript
4
star
19

tour

Product tour for amazing likeastore app
CSS
4
star
20

site

Likeastore marketing site
JavaScript
3
star
21

polyglot

Service and storage for Likeastore localization
3
star
22

app2

The prototype of Likeastore 2.0
CSS
3
star
23

pro

Likeastore Pro website
CSS
3
star
24

ios-app

iOS client for Likeastore
Objective-C
2
star
25

domofon

Talk to your customers
JavaScript
2
star