项目作者: barrosfilipe

项目描述 :
:pager: Nagios/Icinga Plugin to Check PM2 Processes (Remotely)
高级语言: JavaScript
项目地址: git://github.com/barrosfilipe/checkPm2.js.git
创建时间: 2019-02-28T18:44:41Z
项目社区:https://github.com/barrosfilipe/checkPm2.js

开源协议:MIT License

下载


checkPm2.js (Nagios Plugin to Check PM2 Processes)

How to Install

1. Install NVM (Node Version Manager):

wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash


2. Install Node.js latest version:

nvm install node

Note: NVM does NOT share node installation to all users. An easy step is to copy the node binary installed by NVM to /usr/bin


3. Download checkPm2.js to your Nagios server and chmod +x permission:

Plugins default directory: cd /usr/lib64/nagios/plugins

wget https://raw.githubusercontent.com/barrosfilipe/checkPm2.js/master/checkPm2.js && chmod +x checkPm2.js


How to Use

Usage: ./checkPm2.js <pm2 web host> <app name>

Command and Output Example:
  1. $ ./checkPm2.js https://pm2.netflix.com:9615 movies-api
  2. OK: PM2 app:movies-api is Online

Note: You have to enable pm2 web api service by running pm2 web. Default port is 9615


PM2 Status to Nagios Status

PM2 Status NAGIOS CODE
PM2 Online Status NAGIOS_OK: 0
PM2 Stopped Status NAGIOS_WARNING: 1
PM2 Errored Status NAGIOS_CRITICAL: 2
PM2 Unknown Status NAGIOS_UNKNOWN: 3

Requirements:

Node.js v6.0.0+

No NPM needed