How to install and configure “Monit” management system on Ubuntu.

Hello all, Today I’m going to install and configure the “Monit” service monitoring system on Ubuntu server instance.

Monit “is an free an open source software which is a management system for monitoring and take decisions on some of critical points. Specially monit can be used to monitor customized services which are developed by developers. As an example let’s assume if a developer make a service as “service-1” that can be monitored and controlled like start, stop, restart the service by the Monit. And also every actions are notified by the e-mails and administrator can customized the alert conditions and alert notification settings.

This tutorial will help you install and configure the Monit service monitoring system on Ubuntu server. The steps are given below.first get updates on Ubuntu server, then install the “monit” on the server.
1. In first step, Monit has to be installed via Ubuntu terminal.

 $ sudo apt-get update
 $ sudo apt-get install monit

2. After installation “monit” configuration should be done using the /etc/monit/monitrc file.

$ sudo nano /etc/monit/monitrc

# set httpd port 2812 and
# use address localhost # only accept connection from localhost
# allow localhost # allow localhost to connect to the server and
# allow admin:monit # require user 'admin' with password 'monit'
# allow @monit # allow users of group 'monit' to connect (rw)
# allow @users readonly # allow users of group 'users' to connect readonly

In the above section monit administrator have to enable the port (2812) and the whatever the IP address for accessing the Monit system.

3. Then restart the service monit service.

$ sudo /etc/init.d/monit restart

4. Now the Monit web interface can be loaded by using the monit Web URL : http://ipaddess:2812/

m-2

5. As an example, let’s take “apache2” service and configure to moniter via “Monit” dashboard. So open the /etc/monit/monitrc/ and add the following configuration lines under services area.

#Checking the Apache2 service.
check process apache2 with pidfile /var/run/apache2.pid
start program = "/etc/init.d/apache2 start" with timeout 60 seconds
stop program = "/etc/init.d/apache2 stop"

6. After save and exit from the “monitrc”, commit the changes and restart monit service.

sudo monit -t
sudo service monit restart

7. Now you can access the Monit dashboard and you can see the configured service is appeared there, and likewise admins can add more services and also customized services to the  dashboard. If there is any failure on services, admins can restart, start or stop on the particular service.

m-3

Advertisements

2 thoughts on “How to install and configure “Monit” management system on Ubuntu.

  1. In the previous post, you have installed Odoo 8. Do you have any knowledge of setting up Monit to monitor and restart Odoo 8 service?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s