1/5/2024 0 Comments Ubuntu 16.04 monit examplesIf failed host 0.0.0.0 port 80 then restart # NTP #Ĭheck process ntpd with pidfile /var/run/ntpd.pid Start program = “/etc/init.d/httpd start” If failed port 22 protocol ssh then restart # Webserver #Ĭheck process webserver with pidfile /var/run/httpd/httpd.pid Following are some useful configuration examples for Monit, that can be very helpful to see how a service is running, where it keeps its pidfile and how to start and stop a service etc: # SSH # To do this, we will create separate files for every service located within the /etc/monit.d/ directory. Once the initial config is completed, we can configure some of the services we want to monitor. Configuring Programs Self Monitoring using Monit. Once you’ve configured it, you need to start the Monit service to reload the new configuration settings: 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'Īllow # allow users of group 'monit' to connect (rw)Īllow readonly # allow users of group 'users' to connect readonly Configure the Monit monitoring tool.Īfter the installation is complete, edit the main config file to resemble the example below using your favorite text editor and set your own username and password: nano /etc/monit/monitrc set httpd port 2812 and # set the listening port to your desire. Run the following commands in Terminal: apt-get install apache2 libapache2-mod-php First, make sure that all your system packages are up-to-date by running the following apt-get commands in the terminal. We recommend acting as a non-root sudo user, however, as you can harm your system if you’re not careful when acting as the root. A non-root sudo useror access to the root user.SSH access to the server (or just open Terminal if you’re on a desktop).It’s recommended that you use a fresh OS install to prevent any potential issues.A server running one of the following operating systems: Ubuntu 16.04 (Xenial Xerus).I will show you the step-by-step installation Monit monitoring tool on a Ubuntu 16.04 (Xenial Xerus) server. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘ sudo‘ to the commands to get root privileges. This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. You can assign Monit multiple tasks (not only monitoring), so if a certain service fails the check, Monit can alert or do something about it (try to restart the service for example). The monitoring can be directly on the command line or on the web. For those of you who didn’t know, Monit is an open source process tool for Linux operating system which helps you to monitor system process using a web browser also whenever requires it automatically do the maintenance or repair of the particular process in such a way that it can be brought back online. In this tutorial, we will show you how to install and configure Monit on Ubuntu 16.04 LTS.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |