Giter VIP home page Giter VIP logo

mod_statuspage's Introduction

mod_statuspage for Node

Simple express/connect middleware to provide a status page with following details of the nodejs host.

  • Various Versions - Prints NodeJS Version, OS Version, OS Release
  • CPU - Average Load on CPU
  • Memory - Total Memory, Free Memory
  • Traffic - Total Num of Requests, Requests per second, Total KBs Transferred, Total KBs Out etc.
  • Workers - List all the worker processes and the information listed above for each of the worker processes

This module reads the above data from a unix socket generated from the npm module process-watcher. For more details on process-watcher, please refer https://github.com/yahoo/process-watcher.

This module is recommended to be used only in a cluster environment. Also this module is designed to work together with monitr (https://github.com/yahoo/monitr) and process-watcher. For an example of them working together please check examples/sample_cluster.js.

Installation

npm install mod_statuspage

Usage

var express = require('express'),
    status = require('../lib/index.js');

var app = express();

app.use(status({
    url: '/status',
    check: function(req) {
        if (req.something == false) {
            return false; //Don't show status
        }
        return true; //Show status
    },
    responseContentType : 'html'
}));

console.log('Go to: http://127.0.0.1:8000/status');
app.listen(8000);

Configuration

  • url - The URL to respond to, defaults to /status
  • check - A function to check the request to see if the status page should be shown. Default: returns true to always show
  • responseContentType - The Content-Type of the Response, can be html or json, defaults to html
  • ejsTemplate - EJS Template file for html rendering if responseContentType is html, defaults to status.ejs bundled with the module
  • socketPath - The socket path written by watchr, defaults to /tmp/watcher.sock

Build Status

Build Status

Node Badge

NPM

mod_statuspage's People

Contributors

davglass avatar dependabot[bot] avatar drewfish avatar evantorrie avatar rohiniwork avatar rvagg avatar sylvio avatar vsacheti avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mod_statuspage's Issues

version bump + publish to npm

@rohiniwork when you get a chance can you bump the version and publish the new one to npm. Since you've done most of the work on this module, would you consider that worthy of a major/minor version bump?

Cluster only monitorization?

Hi,

In the readme you say 'This module is recommended to be used only in a cluster environment.' Do you mean the nodejs cluster module and only recommend using the monitr/process-watcher/mod-statuspage module when we're using nodejs cluster? If so, why?

Assuming of course, there's several processes in the same machine, the same monitorization logic could be applied - or not..

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.