pm2-mon

0.0.4 • Public • Published

pm2-mon

monit pm2 process by "pgrep node", if only node process, run specified restart command/script.

(I make this thing only because pm2 sometimes crashes, I do not know why it crash, and I have to restart it anyway)

install

npm install pm2-mon -g

help

pm2-mon --help
 
  Usage: pm2-mon [options]
 
  monit pm2 process by "pgrep node"if only node process, run specified restart command/script
 
  Options:
 
    -h, --help     output usage information
    -V, --version  output the version number
    -t, --timer    check pm2 every {timer} milli second, optional, default is 5000
    -c, --cmd      the restart shell-script path, required, will be runned by sh
    -n, --num      when node process less than {num}, the restart shell-script will run, optional, default is 2
 

run

pm2-mon -t 5000 -c example/restart.sh -n 3

suggestion

use tj/mon to run this pm2-mon script.

change log

0.0.3 add num param

License

MIT

Dependents (0)

Package Sidebar

Install

npm i pm2-mon

Weekly Downloads

0

Version

0.0.4

License

none

Last publish

Collaborators

  • zxdong262