health

Resource status monitoring library.

Health

Health is a resource status monitoring library.

npm install -g health 
var health = new (require('health'))(
  setup: [
    { name: 'google', uri: 'http://google.com' },
    { name: 'gmail', uri: 'https://mail.google.com' }
  ]
);

Health setup is just a simple JSON:

[
  { "name": "google", "uri", "http://google.com", "statusCodes": [ 200 ] },
  { "name": "gmail", "uri", "https://mail.google.com", "timeout": "1000" },
]
Attribute Sample values Description Checker Status
uri http://google.com
https://mail.google.com
mongodb://somehost:27017
Resource URI to be checked All Mandatory
name someapp Resource name All Optional
timeout 1000 Request/connect timeout in milliseconds http, https, mongodb Optional
statusCodes [ 200, '3xx', 409 ] An array of acceptable response HTTP status codes, any match means status OK http, https Optional
texts [ 'must exist', 'this must also exist' ] An array of all texts that must exist in response body, any miss means status FAIL http, https Optional