Friday, August 26, 2011

Installing and configuring monit to monitor your server(s)

October 18, 2009 by  
Filed under cPanel, Direct Admin, General, HyperVM, Kloxo, Plesk, Webmin


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

Pre Install Step:

yum install openssl*

Step 1: Installing monit from Source

cd /usr/local/src
tar -zxvf monit-5.0.3.tar.gz
cd monit-5.0.3
./configure –sysconfdir=/etc/monit/
make && make install

Step 1.1: Cleanup source files after working install

rm -Rf /usr/local/src/monit* && cd

Step 2: Create Monit config file

mkdir /etc/monit/
mkdir /etc/monit/cfg
cd /etc/monit/
nano -w /etc/monit/monitrc

Step 2.1: Paste in this text

set daemon  60
set logfile /var/log/monit.log
set mailserver localhost
set alert

# Set mail notification options:
mail-format {
subject: $SERVICE $EVENT at $DATE
message: Monit $ACTION $SERVICE at $DATE on $HOST,

Yours sincerely,

## Inbuilt httpd
set httpd port 3500 and
allow admin:monit

## httpd access control
allow localhost       

# Put your Service config in /etc/monit/cfg/, They will be included.

include /etc/monit/cfg var thickboxL10n = { next: "Next >", prev: "< Prev", image: "Image", of: "of", close: "Close" }; try{convertEntities(thickboxL10n);}catch(e){};