The combination of ease of setup, lightweight implementation and powerful features makes Monit an ideal candidate for a backup monitoring tool. Yet, Monit lends itself to full-blown monitoring, capable of process status monitoring, filesystem change monitoring, email notification, customizable actions for core services, and so on.
Monit is extremely easy to install and reasonably lightweight (with only 500KB in size), and does not require any third-party programs, plugins or libraries. Monit is a cross-platform open-source tool for monitoring Unix/Linux systems (e.g., Linux, BSD, OSX, Solaris). In case a centralized monitor is down, you will still be able to maintain visibility on your core servers from their backup monitor.
One way to add redundancy to your monitoring system is to install standalone monitoring software (as a fallback) at least on any critical/core servers on your network. While centralized monitoring makes an admin's life easy when dealing with many hosts and devices, a dedicated monitoring box obviously becomes a single point of failure if the monitoring box goes down or becomes unreachable for whatever reason (e.g., bad hardware or network outage), you will lose visibility on your entire infrastructure. Many Linux admins rely on a centralized remote monitoring system (e.g., Nagios or Cacti) to check the health of their network infrastructure. Start program = "/etc/init.How to set up server monitoring system with Monit Stop program = "/etc/init.d/mysql stop" Nginx check process nginx with pidfile /var/run/nginx.pid Start program = "/etc/init.d/mysql start" Stop program = "/etc/init.d/httpd stop" MySQL check process mysqld with pidfile /var/run/mysqld/mysqld.pid Start program = "/etc/init.d/httpd start" with timeout 60 seconds (Make sure to change the red parts with your own values, the “pid” files locations for each software could be different) Apache check process apache with pidfile /run/httpd.pid in this section, we are going to configure Monit to prevent your services from being stopped. You can scroll down the “monitrc” file to see the examples of configurations, but all of them are commented, so leave them be and add your own configurations at the very end of the file. Now it’s time to set some services and processes to be monitored by Monit. Now you can visit your Monit web interface at the following address: IP_OR_DOMAIN:2812
Make sure to change your username and password to something strong like below: set httpd port 2812 andĪllow MonitAdmin: 5PbTLadz # require user 'MonitAdmin' with password '5PbTLadz' #allow localhost # allow localhost to connect to the server and #use address localhost # only accept connection from localhost Use address localhost # only accept connection from localhostĪllow localhost # allow localhost to connect to the server andĪllow admin:monit # require user 'admin' with password 'monit'īy default, Monit only listens on “localhost” and only answers to “localhost” as well, So if you want to be able to connect to your Monit interface from anywhere, you have to comment the following lines: set httpd port 2812 and In the Monit global configuration file, scroll down to the following block: set httpd port 2812 and You can set your preferred Email address to get alerts and reports from Monit with the following command: set mailserver port 25 set alert Initial Configurationįor doing some configuration you need to open your Monit global configuration file with the command below: nano /etc/monitrc Enable the web interface You can check your Monit service status with the command below: systemctl status monit Automatic email alerts sent at event triggers.įor installing Monit you need to add the EPEL repository first: yum install epel-releaseĪfter that you can install Monit easily using: yum install monitĪfter the installation process is finished, you can execute the following commands to start Monit service and make it run at startup: systemctl start monit systemctl enable monit.Monitoring of running services, and the ability to start, kill or restart.Capability to act on out-of-bounds values for CPU, RAM, disk, file size, age and more.Automatic process maintenance in a lightweight package.Monit conducts automatic maintenance and repair and can execute meaningful causal actions in error situations, for example, Monit can prevent your services from getting stopped.īelow are some of the main benefits of using Monit:
Monit is a free open source utility for managing and monitoring, processes, programs, files, directories and filesystems on a UNIX system.