upbeat-server v0.0.11
Upbeat
Upbeat is a high performance node-based healthcheck/dashboard. Upbeat allows you to run health checks and provides a dashboard to chart the performance. It also allows you to proxy and cache these health checks so they don't tax your system. You can now reduces the number of health checks to a service from O(N) to O(1).
Installation
As executable
npm install -g upbeatRun upbeat
upbeat config.ymlAs library
npm install upbeatvar upbeat = require('upbeat');
var server = new upbeat.Server(configObject);
server.run();Configuration
Quickstart config:
dashboard:
port: 2468
sync:
redis:
port: 6379
host: localhost
services:
google:
www:
strategy: http
url: http://www.google.com
connection:
strategy: tcp
host: google.com
port: 80Services
Services are a way of grouping several sensor checks together. In the example above, we have a "google" service w hich we check by making a get request to "http://www.google.com" and also seeing if we have a connection to port 8 0 on the "google.com" host. In the yaml config, a service is a "hash" of sensors where the keys are the names of the sensors and the values are the configuration.
Sensors
Sensors are a way of describing a health check. Each sensor config MUST at least have a strategy. Common configuration options accross all strategies are:
- timeout: number (milliseconds) to define how long it will allow a check before declaring it a failure
- interval: number (milliseconds) of time to wait between health checks (called after the result of a check)
- fall: number of fails to be considered down
- rise: number of passes to be considered up
Here are some examples of how you can use sensors and their strategies:
tcp
strategy: tcp
host: google.com
port: 80http
strategy: http
url: http://www.google.compidfile
strategy: pidfile
pidfile: /var/pids/mysql.pidredis
strategy: redis
host: localhost # defaults to localhost
port: 6379 # defaults to 6379
command: [ 'exists', 'foo' ]mysql
strategy: mysql
host: host # required
user: user # required
password: pass # required
sql: "SELECT * FROM users LIMIT 1" # defaults to "SHOW TABLES"