![]() ![]() There are a few different places where you can keep your monitrc file. You do not want any other accounts capable of reading this file or doing things with monit, since it can start and stop services). On FreeBSD, this file was at /usr/local/etc/monitrc.sample, and I copied it over to /root/monitrc (and make absolutely sure that it has permissions of ‘600’ - owner read/write nothing for group or others. It will already exist if you just installed monit on Ubuntu: $ ls -alh /etc/monit/monitrc Next, you’ll want to make sure a monit config file exists - this file will be called ‘monitrc’. Make sure a config file exists (and will be found by monit) To get it installed (assuming Ubuntu, as always, because it’s what most of you have installed): $ sudo apt-get install monit I use it to monitor an Ubuntu machine, a few Debian VPSs, and several heavy pieces of metal running FreeBSD. You heard right - this thing runs on all the Linuxes and Unixes. Installing Monit for Linux/Unix System Monitoring In this post, I’ll take you from “no idea what’s happening on the server” to “closely monitoring critical services.” Follow along! has cool extra features like service management and file-hash checking (to make sure the bad guys haven’t tampered with your system binaries, for example), and.can react when things go wrong (restarting services, running scripts, etc.),.intelligently checks your services to make sure they’re up and responding properly,.Monit can help you monitor all the same things as the others (CPU and disk usage, etc.), but it also In this tutorial, I’ll teach you how to use one of my favorites: Monit ( ). Many of these (Nagios) are forced on them by evil forces who happen to be higher up in the corporate food chain. Use this command link the file from available to enabled.System administrators have a *ton* of different monitoring solutions to choose from. That monit configuration file is in the conf-available and not the conf-enabled. This probably is not used but in case Z-Way does start to spawn child processes if it gets out of hand, it will eventually get restarted. The eighth line would be where a bunch of children processes have been spawned. So this setting should fit what your system has and where your z-way process currently uses for memory usage. My Pi's have 8GB of RAM, so that amount of memory use could be achieved. If you have a Pi with 512MB of RAM, that would not be a valid configuration setting since it could never be reached. 800.0 MB is a lot of memory and Z-Way doesn't use anywhere close to that which is why I also used that value, it would be well outside the norm and clearly an indication of something gone awry. You can set the CPU usage to whatever you like or feel is appropriate for your setup. The sixth line is if the CPU usage is > 80 for five cycles (my cycle is 15 seconds) then restart the process. This means there is obviously an issue that require intervention on your part. The fifth line is if it restarts and then has to keep restarting as it keeps failing, then timeout. The fourth line is checking reachability on port 8083 using http and if a connection cannot be established it is viewed as failed and to restart the process. The start and stop commands are telling it how to start and stop the process. The first line is telling it of the process and where the pid file is. ![]() If loadavg(5min) greater than 3 for 8 cycles then stop If totalmem > 800.0 MB for 5 cycles then restart ![]() If failed port 8083 protocol http then restart Stop program "/etc/init.d/z-way-server stop" Start program "/etc/init.d/z-way-server start" Code: Select all check process z-way-server with pidfile /var/run/z-way-server.pid ![]()
0 Comments
Leave a Reply. |