|
From: | Apoorwa Sharma |
Subject: | Re: Need help to setup monit for Prerender service |
Date: | Mon, 28 Aug 2017 22:40:49 +0530 |
Hi,Hum, did you send the email before review it ?Anyway, let's try to help you.A NodeJS _javascript_ file is not a PID file. So this won't ever work.You have to run you process in a way to keep track of the pid like:nohup node /home/centos/prerender/server.
js > /dev/null 2>&1 & echo $! > /var/run/my-nodejs-server-pid-file .pidthen use this PID file in monit configuration with somethink like belowcheck process Prender with pidfile /var/run/my-nodejs-server-pid-file .pidstart program = "nohup node /home/centos/prerender/server. js > /dev/null 2>&1 & echo $! > /var/run/my-nodejs-server-pid-file .pid"if cpu usage > 90% for 10 cycles then restartBest would be to use a wrapper script instead of the full command line also.Hopes this help mister "Sr. Devops Engineer"2017-08-28 18:37 GMT+02:00 Apoorwa Sharma <address@hidden>:--Hi,I Need help to setup monit for Prerender service I am trying nowcheck process Prender with pidfile /home/centos/prerender/server.js start program = "nohup node server.js > /dev/null&"if cpu usage > 90% for 10 cycles then restart
Apoorwa Sharma
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general -------BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS/IT d(+) s++:- a C++$ ULC(+)>+++$ !P--- L+>$ !E---? W+++$ !N* !o-- K--? w(+) !O---? !M- !V--? PS+? !PE Y+ PGP++>+++ !t-- !5 !X- R(+)>++* tv-? b(-) DI !D- G(+)>+ e+++ h--() r->$ y?*
------END GEEK CODE BLOCK------
--
To unsubscribe:
https://lists.nongnu.org/mailman/listinfo/monit-general
[Prev in Thread] | Current Thread | [Next in Thread] |