Monitor node.js scripts running on an ubuntu instance

I have a node.js script that runs once a day on an Ubuntu EC2 instance. This script retrieves data from several remote APIs and stores it in our local database. Is there a way to track this node.js script on a remote server? There were several cases where the script crashed for some reason, and we could not figure it out without SSHing in the example and checking the logs. However, I created a small system after the first few crashes that send us an email when the script crashes due to some uncaught exception, and also when the script completes execution.

However, we need to develop a better system in which we can track the progress of the script through the web interface of our admin application, which is deployed on top of some other instance, and also starts the start / stop of the script through this interface. What are the possible options for achieving this?

+4
source share
3 answers

If you want to stay in Node.js, then there are several process monitoring tools:

PM2 . CLI -: https://keymetrics.io/. npm gui: https://www.npmjs.com/search?q=pm2+web

Forever , PM2, gui npm.

+2

, :

: cron , .

, , , , . .

, - :

  • script, ( cron, )
  • script ,
  • ( n )
  • , ( , , ..). , , (, pm2 ..).

, . , , n , .

-, , .

. ? 5 . ? . ? . ..

+1

Source: https://habr.com/ru/post/1608635/


All Articles