monit

Monit errors when running “check program” for custom script

六月ゝ 毕业季﹏ 提交于 2019-12-06 08:57:20
问题 I am getting syntax errors when I try to check the exit status of a bash script using monit's "check program". If I run the bash script manually, it doesn't error. But if I do monit reload with my monit check program in the config, monit gives me errors. Here's my current monit .conf file -- check program myscript with path "/etc/monit.d/script_to_run.sh" if status != 0 then alert If I change it to this to make sure monit uses bash to parse the file... check program myscript with path "/usr

monit insists on timing out a program that's running fine

烈酒焚心 提交于 2019-12-06 08:31:08
I'm having a problem monitoring a program using monit. I'm running this on a raspberry pi, having built monit 5.11 from source; I tried using the version from the repositories, but it was 5.4 and didn't support some of syntax below that I want. I'm trying to follow the "Q: I have a program that does not create its own pid file. Since monit requires all programs to have a pid file, what do I do?" entry in the FAQ . Here's my start_sensors.sh script (which just runs my python program, instead of the java program in the wiki example): #!/bin/bash case $1 in start) echo $$ > /var/run/start_sensors

Terminal says delayed_job starting, but not doing anything

荒凉一梦 提交于 2019-12-06 04:37:29
I have an app that works perfectly on my local machine and am deploying it now. I have the VPS all set up and it pretty much works, as well. My problem comes from not being able to start delayed_job. I do the "ruby script/delayed_job start RAILS_ENV=production" while SSHd to the app and it returns "delayed_job: process with pid 11547 started." When I look for the process in htop, I can't find it. So I dug around and read that Monit can keep delayed_job going. I set that up, hoping I could start up the delayed_job that way. There's no delayed_job.pid, though, so I didn't get far. I ended up

monitoring multiple delayed job workers with monit

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-06 02:06:19
问题 I have read a lot about monitoring delayed_job with monit. The implementation is pretty easy and straight forward. But When one worker is not enough how do I setup monit to ensure that, let's say, 10 workers are constantly running? 回答1: You can just replicate the same config you have for the first worker N times. Suppose you have 5 workers, you'll monitor all of them with the following: check process delayed_job.0 with pidfile /path/to/shared/pids/delayed_job.0.pid start program = "/bin/su -c

Monit Ruby on Rails Sidekiq

安稳与你 提交于 2019-12-05 05:58:30
I'm trying to set up Monit for Sidekiq. Here's what I have so far for my config file: check process sidekiq_site with pidfile /var/www/site/tmp/pids/sidekiq.pid start program = "bundle exec sidekiq -C /var/www/site/config/sidekiq.yml -P /var/www/site/tmp/pids/sidekiq.pid" with timeout 90 seconds if totalmem is greater than 200 MB for 2 cycles then restart # eating up memory? group site_sidekiq The problem is I'm getting a message when I run monit reload that the program "bundle" does not exist. Does anyone have a solution for this? check this: https://groups.google.com/forum/?fromgroups=#

monitoring multiple delayed job workers with monit

送分小仙女□ 提交于 2019-12-04 05:18:06
I have read a lot about monitoring delayed_job with monit. The implementation is pretty easy and straight forward. But When one worker is not enough how do I setup monit to ensure that, let's say, 10 workers are constantly running? You can just replicate the same config you have for the first worker N times. Suppose you have 5 workers, you'll monitor all of them with the following: check process delayed_job.0 with pidfile /path/to/shared/pids/delayed_job.0.pid start program = "/bin/su -c '/usr/bin/env RAILS_ENV=production /path/to/current/script/delayed_job -n 5 start' - user" stop program = "

get monit to alert first and restart later

不打扰是莪最后的温柔 提交于 2019-12-03 16:23:34
问题 I would like to handle a kind of chain action in monit. check for a process and alert immediately. restart process after a num of cycles. My tries (so far): check process myprocess with pidfile /run/my.pid start program = "/path/to/binary start" with timeout 60 seconds stop program = "/path/to/binary stop" with timeout 60 seconds if not exist for 3 cycles then restart if not exist then alert if 3 restarts within 3 cycles then timeout Does not alert and keeps in state "running" on failing PID

get monit to alert first and restart later

元气小坏坏 提交于 2019-12-03 05:48:07
I would like to handle a kind of chain action in monit. check for a process and alert immediately. restart process after a num of cycles. My tries (so far): check process myprocess with pidfile /run/my.pid start program = "/path/to/binary start" with timeout 60 seconds stop program = "/path/to/binary stop" with timeout 60 seconds if not exist for 3 cycles then restart if not exist then alert if 3 restarts within 3 cycles then timeout Does not alert and keeps in state "running" on failing PID but restarts after the 3 cycles. check process myprocess with pidfile /run/my.pid start program = "

How to monitor delayed_job with monit

匿名 (未验证) 提交于 2019-12-03 02:20:02
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 由 翻译 强力驱动 问题: Are there any examples on the web of how to monitor delayed_job with Monit ? Everything I can find uses God , but I refuse to use God since long running processes in Ruby generally suck. (The most current post in the God mailing list? God Memory Usage Grows Steadily .) Update: delayed_job now comes with a sample monit config based on this question. 回答1: Here is how I got this working. Use the collectiveidea fork of delayed_job besides being actively maintained, this version has a nice script/delayed_job daemon you can use with

Monit fails to start process

匿名 (未验证) 提交于 2019-12-03 01:35:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I've written a scrip that works fine to start and stop a server. #!/bin/bash PID_FILE='/var/run/rserve.pid' start() { touch $PID_FILE eval "/usr/bin/R CMD Rserve" PID=$(ps aux | grep Rserve | grep -v grep | awk '{print $2}') echo "Starting Rserve with PID $PID" echo $PID > $PID_FILE } stop () { pkill Rserve rm $PID_FILE echo "Stopping Rserve" } case $1 in start) start ;; stop) stop ;; *) echo "usage: rserve {start|stop}" ;; esac exit 0 If I start it by running rserve start and then start monit it will correctly capture the PID and the server