0.0.7 • Published 7 years ago

servator v0.0.7

Weekly downloads
-
License
ISC
Repository
-
Last release
7 years ago

alt tag contributions welcome npm version

Servator

Endpoint Monitor Tool -- UNDER DEVELOPMENT --

Features

Produces both live and analytical monitoring data. Can notify using:

  • Post to slack channel
  • Post post to hipchat room
  • Send to email / email groups
  • SMS (twilio)
  • Server Side Logging
  • Public API

Installation

Project was build with node 6.7.0

$ npm install --save servator
or
$ git clone git@github.com:megmut/servator.git

Running

$ npm start

By default, this projetc runs on port , however to change this, edit the dev server object in the webpack.config.js file

port: process.env.PORT || 56056

Creating Monitors

There are several ways to create monitors.

  1. The first is by setting them up in the config json files. Navigate to 'config -> monitoring.json. Each record here will get created as a new monitor. Default configuration are applied if there are none specified. Here is an example config file
"myEndpoint": {
    "url": "67.254.154.247",
    "timeout": "300000",
    "onDown": [
        "nicholasmordecai@gmail.com"
    ]
}
  1. Secondly, you can extend the monitor template class found in src -> custom. You can set the monitor configuration up here, and override or extend any function you wish. Here is an example of extending the monitor class
import Template from './template';

export default class MyEndpoint extends Template {
    constructor(monitor) {
        super(monitor);
        this.website = 'https://www.myendpoint.com/';
        this.interval = 2500; // in ms
    }
}

You can re-route any of the response handlers and controllers as you wish.

  1. Thirdly, you can create a new monitor via the API. Send a post request to http://serverip:56056/api/create?object. The object should look similar to the configuration json
var monitor = {
    "myEndpoint": {
        "url": "67.254.154.247",
        "timeout": "300000",
        "onDown": [
            "nicholasmordecai@gmail.com"
        ]
    }
}

$.ajax({
  type: "POST",
  url: http://serverip:56056/api/create,
  data: monitor,
  success: success,
  dataType: dataType
});

API

coming soon...