Yesterday the switch where this server was connected to died. Replaying a configuration from the backup from the day before yesterday didn't help.įinally I checked /var/log/messages (should have done that at first, but you know how it goes), where I discovered the wonderful "init: Id "mo" respawning too fast: disabled for 5 minutes". However, every five minutes monit sent a SYNC, received a SYNC/ACK, but instead of acknowledging with an ACK the very next package was a RST. When I tcpdumped the traffic on the monit instance everything worked fine: Monit opens a TCP connection and the whole process of sending SYN, SYN/ACK, ACK, traffic and finally FIN, FIN/ACK etc. When I investigated further I discovered that the firewall did open all necessary connections, so it wasn't a fault there. ![]() The server, however, *was* reachable and working (as it tested successfully from another server). Sometimes it skipped the five minutes and came back after ten minutes or more (but always a multiple of five), sometimes it jumped one minute ahead and faulted after six minutes, to continue then again after five. Since yesterday I received the message "connection failed, INET[via TCP is not ready for i|o - Interrupted system call" every 5 minutes from a monit instance. I write this purely because googling for the error message did not show up with a single useful entry. Skip the text and jump to the solution at the bottom if you are not interested in my adventure. hoping that this helps someone somewhere in the future. Script is saved in a file called /bin/xyz, you can call this script from monit Starting an imaginary program (a Java program in this case). ![]() Since monit requires all programs to have a pid file, what do I do?Ī: Create a wrapper script and have the script create a pid fileīefore it starts the program. Q: I have a program that does not create its own pid file. Test for zombie processes and will raise an alert if a process has become a Some serversĬan crash and leave a zombie process, and appear to run. Program is not running and restart it even if a pid file exist. Manner, then the process ID (pid) will not exist and monit will know that the If a program crashes and dies in a "normal" monit check program for custom script to monitor php5-fpm status page and nginx status page.Q: If a program crashes without removing its pid file, will monit recognise that the program is not running?Ī: Yes, Monit will always check that the pid number in a pid fileīelongs to a running process.You can open in browser to see visual graphs! TODO "http_password" => "easyengine", Setup CronĪdd following line to cron: * * * * * php /var/> /var/log/monit-graph.log View Graphs Open config.php and adjust following values: "url" => "localhost:2812", You can use commercial version M/Monit for a lot many features or free script monit-graph Install monit-graph cd /var/www//htdocs You may also open :2182 in your browser to use web-based interface. Run command monit status, it should something like: The Monit daemon 5.13 uptime: 2m Then start monit using service monit start Verify Startįirst test your config using monit -t command. Also, change numbers 6 and 4 in loadavg lines based on number of CPU cores on your system. #set mmonit may also wish to change username admin and password easyengine. If loadavg (5min) > 4 for 2 cycles then alert If loadavg (1min) > 6 for 2 cycles then alert If cpu usage (user) > 70% for 2 cycles then alert If memory usage > 80% for 2 cycles then alert ![]() Set eventqueue basedir /var/monit slots 5000Ĭheck process mysqld with pidfile "/var/run/mysqld/mysqld.pid"Ĭheck process php5-fpm with pidfile "/var/run/php5-fpm.pid"Ĭheck process nginx with pidfile "/var/run/nginx.pid" cd ~Īdd/Update following in /etc/monit/monitrc #Monitoring Interval in Seconds Following lines will install Monit 5.14 for Ubuntu 64-bit. Go to and pick correct binary for your system. Following installs Monit 5.3 on Ubuntu 12.04.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |