![]() If it isn't running, it will (re)start the Domoticz service. This will check every minute if the Domoticz service is running. */1 * * * * sudo /home/pi/domoticz/scripts/check_domoticz_online.sh 2> & 1 > /dev/nullĮxit the crontab editor by pressing CTRL-O (character 'O', not zero) and hitting Enter. There are number of scripts you can try each with their own advantages. Using Monit is preferred (also because it can check multiple processes). However this one is not advised as it can cause a infinite loop of restarting Domoticz. You can check it Domoticz is running though a simple bash script. When you are done modifying/updating/whatever, start Domoticz first: Otherwise if you stop Domoticz by hand, Monit will kick in directly and start Domoticz again. In this scenario you first have to stop the monitoring by Monit. Updating Domoticz by hand (Pulling latest code from Github & then compiling) for example. There are probably some situations where you want Monit not to kick in directly when Domoticz is stopped. See also the monit documentation: Pausing Monit (for updating Domoticz by hand for example) You can also run monit in 'verbose' mode, so you can see what it does. This also applies to the Raspberry Pi 2 i think, because it has a quadcore processor (Raspberry Pi 1 has a single core processor). If you have a system with 4 cores (quadcore), a process is hogging up CPU when it is > 25% (100 / 4 = 25). So if you want to restart a process when it consumes 100% CPU or more, you need to divide 100 by the amount of cores you have. When you want to monitor the CPU-usage of a single process (instead of the whole machine), be warned about this: īasically, monit sees the usage spreaded on all processorcores. ![]() Notes Pay attention when monitoring CPU-usage of process Once you have configured all of the above steps, Domoticz will be tracked constantly and the process will be restarted automatically if it would have stopped running because of. Typing the command below displays monit’s status Monit can be started with a command that then keeps it running in the background Once you have set up the configuration, check the syntax:Īfter resolving any possible syntax errors, you can start running all of the monitored programs. Note: For monit 70% for 3 cycles then restart for example (put it between the 'then restart' and the last 'if 5 restarts.' line). I would recommend doing this, so you have a good view on stability of your system (how often does Monit needs to kick in actually?). You can setup Monit to inform you about every status update by e-mail.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |