How to make sure an application keeps running on Linux

前端 未结 16 1367
清歌不尽
清歌不尽 2020-11-28 18:51

I\'m trying to ensure a script remains running on a development server. It collates stats and provides a web service so it\'s supposed to persist, yet a few times a day, it

16条回答
  •  无人及你
    2020-11-28 19:30

    Monit is perfect for this :)

    You can write simple config files which tell monit to watch e.g. a TCP port, a PID file etc

    monit will run a command you specify when the process it is monitoring is unavailable/using too much memory/is pegging the CPU for too long/etc. It will also pop out an email alert telling you what happened and whether it could do anything about it.

    We use it to keep a load of our websites running while giving us early warning when something's going wrong.

    -- Your faithful employee, Monit

提交回复
热议问题