
Here, Monit has been instructed to alert when the load average, total system memory use or CPU usage exceeds the specified limits. Monit can monitor server resource utilization and alert you when your server is under unusual load: check system mail Configure Monit’s Checking Actions System Values Securing Your Server - Configuring a Firewall. You may need to configure your firewall package or iptables if you have a default deny policy. If you choose to implement the web interface, be sure the port Monit uses (default 2812) is exposed to the devices on which you’ll be viewing it. You can optionally restrict web interface access to just your IP address. If there is no other web server running on your host, Monit can run on port 80 if you specify port 80 in the config file. You can find a list of providers at Wikipedia, here:įinally, as far as configuring Monit itself, you can enable the embedded web server to display all your system tests as a web page: set httpd port 2812 The config file defaults normally suffice: set eventqueueĮnter the email address to which Monit should deliver its alerts: set alert you prefer to receive alerts as text messages, use your cell provider’s email-to-text gateway if one is provided. To do this, you specify a directory to store the undelivered messages and how many messages you want to allow to queue up. It will not retry if no servers succeed, unless you also configure the event queue. Monit will try each server in turn until one succeeds. You can also specify multiple mail servers by entering more than one server name, separated by comma: set mailserver, If you need to specify a port other than the default for SMTP (25), add it following the server name: set mailserver port 2025 Specify what server you will send mail through on this line: set mailserver Linux System Administration Basics - Sending Email From Your Server for help with configuring this. It can use a Mail Transfer Agent (MTA) on the local host if you have one configured, or an outside mail server that will accept incoming SMTP traffic from your host. Monit can optionally alert you by email when it triggers on an event. Including the delay line will prevent Monit from sending alerts that all services are down every time you boot the server. Other processes may take some time to complete their own startup. To have Monit delay starting on system boot, include the delay line: set daemon 300 If you change this value, you will need toĬonsider setting the testing interval at up to 5 minutes if minimizing a load on your server is more important than instant alerts and responses. Begin by running Monit at the default setting of two minutes and evaluate its performance. The value you choose will depend on how many tests you define, how quickly you need Monit to act on events, and how much load the tests themselves add to your server. This is the interval (in seconds) at which Monit runs its tests. We’ll start by setting up the monit process itself. Open this file now in your favorite text editor. Monit’s configuration is in the file /etc/monit/monitrc. If your distro has System V (CentOS 6, Debian 7) or Upstart (Ubuntu 14.04): sudo service monit restart If you’re using a Linux distro with systemd (CentOS 7, Debian 8, Fedora 22): sudo systemctl restart monit Sudo systemctl enable monit & sudo systemctl start monit

#Monit set alert install
Using the following commands: sudo apt-get update & sudo apt-get upgradeįedora sudo dnf update & sudo dnf install monit

list inside the /etc/apt// directory: deb buster-backports mainĪfter you save the changes and close the text editor, you should be able to install Monit. To enable the Monit repository, include the following lines in the /etc/apt/sources.list file or create a new file ending in. In order to install Monit on Debian 10, you need to enable the buster-backports repository. Debian 10 does not include Monit in the standard repositories.
