diff --git a/README.md b/README.md index 7a21210c..7197246b 100644 --- a/README.md +++ b/README.md @@ -15,6 +15,7 @@ pm2 is perfect when you need to spread your stateless Node.js code accross all C - Pause unstable process (avoid infinite loop) - Restart on file change with `--watch` - Monitoring in console +- [Free server/pm2 monitoring by ping strategy](#builtin-remote-monitoring) Tested with Node v0.11, v0.10 (https://travis-ci.org/Unitech/pm2). @@ -57,6 +58,7 @@ Thanks in advance and we hope that you like pm2! - [Examples](#a3) - [Differents ways to launch a process](#a667) - [Options](#a987) +- [Builtin remote monitoring](#builtin-remote-monitoring) ### Features @@ -144,6 +146,11 @@ $ pm2 describe 0 # Display all informations about a specific process $ pm2 monit # Monitor all processes +# Builtin monitoring via PING strategy + +$ pm2 subscribe my@email.com # Send an email if your server or pm2 is down +$ pm2 unsubscribe # Unable the remote monitoring + # Logs $ pm2 logs # Display all processes logs in streaming @@ -238,6 +245,31 @@ Options: --run-as-group The group or gid to run a managed process as ``` + + +## Builtin remote monitoring + +On installation, you're asked if you want to enable the remote monitoring for your server or pm2. +If accepted and if you set the right email, you will receive an email if something hangs (offline). + +This monitoring strategy **only do a ping** at a regular interval to pm2.io servers. + +If you want to enable it after installation just do : + +```bash +$ pm2 subscribe my@email.com +# Once the monitoring enabled, you have to restart pm2 : +$ pm2 dump +$ pm2 kill +$ pm2 resurrect +``` + +If you want to stop the monitoring do : + +```bash +$ pm2 unsubscribe +``` + # Features diff --git a/lib/CLI.js b/lib/CLI.js index 8bdd8e9c..34ffb3ca 100644 --- a/lib/CLI.js +++ b/lib/CLI.js @@ -817,7 +817,8 @@ CLI.subscribe = function(email) { printOut('Subscribing...'); WatchDog.createConfFile(email, function() { - printOut('PM2 is now monitored'); + printOut('PM2 is now ready for monitoring via PING strategy. To enable it, please restart pm2'); + printOut('For more informations : https://github.com/Unitech/pm2#builtin-remote-monitoring'); exitCli(cst.SUCCESS_EXIT); }); };