GithubHelp home page GithubHelp logo

isabella232 / pm2-watchdog Goto Github PK

View Code? Open in Web Editor NEW

This project forked from instructure/pm2-watchdog

0.0 0.0 0.0 79 KB

Module is continuously checking the health of PM2 NodeJS processes by calling the specified HTTP(s) endpoint. If the HTTP server is unavailable or response is not 2xx, then watchdog will restart the PM2 process.

License: MIT License

JavaScript 100.00%

pm2-watchdog's Introduction

PM2 module: Webserver Watchdog

Module is continuously checking the health of PM2 NodeJS processes by calling the specified HTTP(s) endpoint. If the HTTP server is unavailable or response is not 2xx, the PM2 process will be restarted.

Installation

pm2 install ma-zal/pm2-watchdog

Basic configuration

# Enable watching for PM2_PROCESS_NAME. Module will continuously checks the availability of URL.
pm2 set pm2-watchdog:url-PM2_PROCESS_NAME URL

Example:

pm2 set pm2-watchdog:url-helloworld http://localhost:3000/status

Optional advanced configuration

# Set the webserver checking for every NUMBER seconds.
# Default is 10 seconds (if no value is specified).
pm2 set pm2-watchdog:checking_interval NUMBER

# Set the app restart when NUMBER webserver checks had failed in a row.
# Default is 3 times (if no value is specified).
pm2 set pm2-watchdog:fails_to_restart NUMBER

# Enable message output level.
# Note: Log files are `~/.pm2/logs/pm2-watchdog-out.log`
#                 and `~/.pm2/logs/pm2-watchdog-error.log`
# Default is `info` (if no value is specified).
# Possible values (levels):
#   `info`  - info messages only (default)
#   `debug` - info + debug messages
#   `trace` - info + debug + trace messages
pm2 set pm2-watchdog:debug LEVEL

# Web request timeout in millis NUMBER .
# Default is 5000 millis.
pm2 set pm2-watchdog:checking_timeout NUMBER

Logging

The processes restarts are logged to error log file (to error output). Therefore if you are tracking errors of your applications, you can redirect the error messages to get complete overview what is happening in your server.

Version Changelog

1.0.1 (17.1.2018)
  • Added configurable request timeout

pm2-watchdog's People

Contributors

ma-zal avatar bahzuercher avatar dependabot[bot] avatar taniman avatar

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.