
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
#Upbeat
Process monitoring with scalable health/performance checking.
Upbeat provides several useful features:
##Complex healthcheck strategies
For accurate healthchecks, sometimes the likes of monit, nagios and/or haproxy is not enough. An example would be testing a mysql server to see if 1) the process is running 2) a query works 3) how fast the query was This is just and example of what upbeat is meant to do. It is not meant to replace the tools mentioned previously, but to actually play nicely with them.
##Fast and scalable remote health checking
Upbeat leverages nodes quickness and allows service healthchecks to be temporarily cached allowing more throughout put in your healthchecks. This will enable every machine to know the status of every other machine in a cluster without doing an expotential number of "real" healthchecks. In the context of cloud computing, where high throughput load balancing is non-trivial this becomes very useful.
##Web Dashboard##
See your statuses on one page or use them for scripting through an api.
##Forever Integration##
Define processes to be run and how to monitor them.
#Documentation
##InstallationAssuming you have node and npm installed, run:
npm-g install upbeat
upbeat ./my/upbeat-config.yml
Now an http server will be running that you can query for health statuses
##Example Config File:port: 2468
host: 127.0.0.1
services:
rails-process:
- strategy: mysql
socket: /tmp/mysql.sock
- strategy: process
pidfile: /tmp/rails.pid
- strategy: http
url: http://localhost:3000/
- strategy: http
port: 3000
host: 127.0.0.1
interval: 3000
timeout: 1000
factual-api:
- name: places
strategy: http
url: http://api.v3.factual.com/t/places
get:
KEY: <my key>
q: starbucks
google.com:
- name: homepage
url: http://www.google.com
strategy: http
redis:
- strategy: redis
port: 6537
host: 127.0.0.1
mysql:
- strategy: mysql
socket: /tmp/mysql.sock
##Web Dashboard:
Upbeat uses YAML for configuration. There are several concepts to take note of when running configuring upbeat: server, services, actions and strategies
###Global Server Configuration:In the top level of the yaml configuration you have 4 main categories:
To disable the UI altogether:
webapp: false
To run the web app on a particular port:
webapp:
port: 2468
address: 127.0.0.1
By default, the webapp is enabled and runs on port 2468
###Forever:You can integrate forever by using the "processes" keyword in your config.
processes:
NodeServer:
command: "/usr/local/bin/node"
options: [ "server.js" ]
checks:
- strategy: http
url: http://localhost:1337
status: 200
interval: 3000
- strategy: http
url: http://localhost:1337/hello
status: 200
interval: 3000
###Services:
The services section in the global configuration has to be a hash where the key is the name of the service and the value is an array of "actions" for the service to check.
###Actions:Actions are a hash that have one required field: strategy. Stragety is used to tell upbeat how to test a particular service. Every action has these fields available to it:
optional fields
Checks to see if a process is running via pidfile:
Example:
services:
my-process:
- pidfile: /tmp/my.pid
strategy: process
**http**
The http strategy will send a request to the server. Fields:
Example:
services:
http-actions:
- url: http://www.google.com
strategy: http
matches: html
lambda: "function (data) { return data.match(/html/); }"
- name: test-google
url: http://www.google.com
strategy: http
headers:
Host: www.google.info
- name: test-search
url: http://www.google.com
strategy: http
get:
q: upbeat
- name: test-google
strategy: http
url: http://www.google.com
rise: 3
fall: 1
**upbeat**
Yes, upbeat can monitor other upbeat servers. Fields:
Example:
port: 2467
services:
upbeat:
- strategy: upbeat
**tcp**
Strategy to check if a connection to a port can be established. Fields:
The mysql strategy will connect to a mysql server and perform a query. Fields:
connecting - either use the socket field or:
Example:
services:
mysql:
- strategy: mysql
socket: /tmp/mysql.sock
**redis**
The redis strategy will connect to a redis server and issue an "ECHO hello" command. Fields:
Example:
services:
redis:
- host: 127.0.0.1
port: 6537
strategy: redis
**oauth**
Upbeat supports basic OAuth get requests. Fields:
Example:
services:
oauth:
- strategy: oauth
url: http://api.v3.factual.com/t/places
key: "My Key"
secret: "My Secret"
Its pretty simple to register a custom strategy. There are 3 things the object needs to have:
Example:
var AlwaysPass = function (config) { this.config };
AlwaysPass.prototype.check = function (callback) {
callback(true);
};
AlwaysPass.prototype.clear = function () {
// no op
};
require('./upbeat').registerCallback('always-pass', AlwaysPass);
Config file
services:
myservice:
- strategy: "/home/me/my-strategy.js"
key0: val0
key1: val1
All logging is optional, but here are some parameters you can use:
logging:
console: false # defaults to true
files:
- /var/log/upbeat.log
- file: /var/log/upbeat.errors.log
level: error
If you want to build your own listeners to upbeat, please follow lib/upbeat/logger.ms for an example. You can also look at bin/upbeat for an example of how to instantiate an upbeat server via config file.
var c = new upbeat.Configurer(<config object>);
c.server.on('change', function (service) { console.log('something changed') });
c.start();
# API
Using configurer to instantiate your server.
var config = ... json config ...;
var configurer = new upbeat.Configurer(config);
configurer.start();
The configurer has 3 main members:
The upbeat server is the object that does all the health checking and process management.
up
Every time a service comes up.
down
Every time a service goes down.
change
Every time a services changes status.
snapshot
Every time a service gets snapshotted
A container for a winston object and is a proxy for a lot of the server events.
A container for an express application.
FAQs
Fast health and performance monitoring with process handling
We found that upbeat demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.