How to Install
$ npm install pm2-monitor$ npm install -g pm2-monitor
Pm2-monitor has several options, in order to change them access the config.js file
server:port:10022 //port that pm2 will be hostedhost:'localhost' //if access is outside closed network, use real Ip Address,refresh: 2 //(seconds) refresh ratestartup:active:false //enables creation of startup scriptpath:'./pm2_startup.json' //location where startup script is generatedauth:file:'./pm2_authfile' //do not changelogs:active:false //enables realtime logs (uses a lot of CPU)maxsize:1 //max size in MB of the log per processnotification:email:active:false //activates notification by emaillimits:memory:50 //Memory usage limit to send emailcpu:50 //Cpu usage limit to send emailsmtp:host: 'smtp.yourserver.com' //setup your email providerport: 587 //provider portsecure:false //provider uses ssl or notignoreTLS:trueauth:user: 'email@example.com'pass: 'password'emailTo:'recipient' //email that will receive notificationsemailFrom:'firstname.lastname@example.org' //email to appear as sendersms:active:false //activates notification by SMStels:"gsm":"telephone" //celulars to receive notificationgsm:"telephone2"limits:memory:80cpu:80auth:user:'username' //infoBIP usernamepass:'password' //infoBIP password//In order to receive SMS, an infobip account must be created ...//frequency:60 //(seconds) frequency that notifications will be sent (if limits are reached)
To start the process, you need to have pm2 up and running.
$ sudo node pm2_monitorjs //to start without authentication$ sudo node pm2_monitorjs user password //to create user//once an user is created, node pm2_monitor.js will start with authentication//note that pm2_monitor may be started within pm2// sudo pm2 start pm2_monitor.js
Total Memory Usage //displays the memory usage of the server running pm2-monitorTotal Cpu Usage //displays the cpu usage of the server running pm2-monitor