Thursday 8 June 2017

Howto M/Monit in Ubuntu



Monit is a free open source utility for managing and monitoring, processes, programs, files, directories and filesystems on a UNIX system. Monit conducts automatic maintenance and repair and can execute meaningful causal actions in error situations.

So basically, it is a Network Monitoring System (NMS) which monitors, logs servers and its process. Lets roll with the installation and configuration but remember we need to have Apache server already installed.

# apt-get install monit
It will install in a flash, no sweat.

The main config file of monit is located in "/etc/monit" called monitrc.
Here, we need to fix few things and monit is up and running, its way faster than compared to Nagios (whose installation is most tedious)

# vim /etc/monit/monitrc
Just uncomment those lines seen in the image below



set httpd port 2812use address localhostallow localhostallow admin:monitallow @monitallow @users readonly

Let's start monit

# /etc/init.d/monit start

then open up your browser and login using username and password admin and monit respectively.

This is how it looks at the start, we have installed monit successfully and its working perfectly.

Now, lets try and monitor Apache and SSH server.

# vim /etc/monit/monitrc

Append following lines



Now, restart the monit

# /etc/init.d/monit restart
Lets check the browser we should get following results

Hopefully, we can do more and you can test it by disabling Apache or SSH Server

Cheers


No comments:

Post a Comment