Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

health

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

health - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

lib/formatters/html.js

3

CHANGELOG.md

@@ -0,2 +1,5 @@

### 0.0.2-pre
* Change status from OK/FAIL to ok/fail
### 0.0.1
* Initial version

6

lib/checkers/http.js

@@ -42,6 +42,6 @@ var bag = require('bagofholding'),

_result.status = 'OK';
_result.status = 'ok';
} catch (e) {
_result.status = 'FAIL';
_result.status = 'fail';
_result.desc = e.message;

@@ -56,3 +56,3 @@ }

if (err) {
cb(null, { status: 'FAIL', desc: err.message });
cb(null, { status: 'fail', desc: err.message });
} else {

@@ -59,0 +59,0 @@ cb(null, result);

@@ -24,7 +24,7 @@ /*jshint esnext: true */

if (err) {
result.status = 'FAIL';
result.status = 'fail';
result.desc = err.message;
} else {
conn.close();
result.status = 'OK';
result.status = 'ok';
}

@@ -31,0 +31,0 @@ cb(null, result);

@@ -8,3 +8,3 @@ var util = require('util');

* - name: resource name
* - status: OK or FAIL
* - status: ok or fail
* - uri: the resource that was checked

@@ -11,0 +11,0 @@ * - desc: result description, e.g. failure explanation

@@ -8,3 +8,3 @@ var Js2Xml = require('js2xml').Js2Xml;

* - name: resource name
* - status: OK or FAIL
* - status: ok or fail
* - uri: the resource that was checked

@@ -11,0 +11,0 @@ * - desc: result description, e.g. failure explanation

@@ -9,3 +9,3 @@ {

],
"version": "0.0.1",
"version": "0.0.2",
"homepage": "http://github.com/cliffano/health",

@@ -34,3 +34,3 @@ "author": "Cliffano Subagio <blah@cliffano.com> (http://blog.cliffano.com)",

"mongodb": "1.2.14",
"js2xml" : "0.0.6",
"js2xml": "0.0.6",
"underscore": "1.4.4",

@@ -53,2 +53,2 @@ "validator": "1.1.0"

]
}
}

@@ -7,2 +7,6 @@ Health [![Build Status](https://secure.travis-ci.org/cliffano/health.png?branch=master)](http://travis-ci.org/cliffano/health) [![Dependencies Status](https://david-dm.org/cliffano/health.png)](http://david-dm.org/cliffano/health)

This is handy when you want to monitor the status of multiple resources using a simple configuration file. For example, if your application requires a web service and a MongoDB database to be available, Health module can monitor those resources and return status ok/fail against each resource along with the response time.
It also supports result caching via ttl attribe of each resource, which is handy when you want to monitor multiple resources at a different interval or to reduce the load on certain resources.
Installation

@@ -31,2 +35,3 @@ ------------

{ "name": "gmail", "uri", "https://mail.google.com", "timeout": "1000" },
{ "name": "mongodb", "uri": "mongodb://somehost:27017", "timeout": 200, "ttl": 30000 }
]

@@ -37,45 +42,63 @@

<th>Attribute</th>
<th>Sample values</th>
<th>Type</th>
<th>Description</th>
<th>Checker</th>
<th>Status</th>
<th>Usage</th>
<th>Default</th>
<th>Example</th>
</tr>
<tr>
<td>uri</td>
<td>
http://google.com<br/>
https://mail.google.com<br/>
mongodb://somehost:27017</td>
<td>Resource URI to be checked</td>
<td>string</td>
<td>Resource URI to check</td>
<td>All</td>
<td>Mandatory</td>
<td></td>
<td>mongodb://somehost:27017</td>
</tr>
<tr>
<td>name</td>
<td>someapp</td>
<td>string</td>
<td>Resource name</td>
<td>All</td>
<td>Optional</td>
<td></td>
<td>someapp</td>
</tr>
<tr>
<td>ttl</td>
<td>number</td>
<td>Cache time to live in milliseconds</td>
<td>All</td>
<td>Optional</td>
<td></td>
<td>30000</td>
</tr>
<tr>
<td>timeout</td>
<td>1000</td>
<td>number</td>
<td>Request/connect timeout in milliseconds</td>
<td>http, https, mongodb</td>
<td>Optional</td>
<td></td>
<td>500</td>
</tr>
<tr>
<td>statusCodes</td>
<td>[ 200, '3xx', 409 ]</td>
<td>array</td>
<td>An array of acceptable response HTTP status codes, any match means status OK</td>
<td>http, https</td>
<td>Optional</td>
<td></td>
<td>[ 200, '3xx', 409 ]</td>
</tr>
<tr>
<td>texts</td>
<td>[ 'must exist', 'this must also exist' ]</td>
<td>An array of all texts that must exist in response body, any miss means status FAIL</td>
<td>array</td>
<td>An array of all texts that must exist in response body, any of them does not exist means status FAIL</td>
<td>http, https</td>
<td>Optional</td>
<td></td>
<td>[ 'foo', 'bar' ]</td>
</tr>
</table>
</table>
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc