Friday 20 January 2012

How to Install and Configure M/Monit on RHEL X86_64 step by setp

nstallation and configuration procedure are listed below:
..........................................................

M/Monit expand upon Monit's capabilities to provide monitoring and management of all Monit enabled hosts from one easy to use web-interface.
This M/Monit release require Monit 5.2 or later as an agent. Monit can be downloaded from http://mmonit.com/download. See Supported Platforms for the exact OS versions supported by the binaries.

To install M/Monit:

1. First, check that M/Monit is supported on your OS platform

2. Get the latest release from http://mmonit.com/download/

3. Download and unpack the tar.gz file in a directory, any directory will do,
but unpacking in /opt or /usr/local are good choices.

4. Go to the unpacked mmonit- directory

5. Run M/Monit using: ./bin/mmonit

6. Point your Browser to the host where monit is installed (or "localhost"
if running on the same machine), for example: http://localhost:8080/
and login as user "admin" with password "swordfish".

You can run mmonit as any user, including root. It is not necessary to create a standalone account to run mmonit.

7:now do some changes on monit configuration files to connect both the servers.

vim /etc/monit.d/monitrc

add the following entries at the top of every files you want to monitor

set eventqueue basedir /var/monit/ slots 1000
set mmonit http://monit:monit@192.168.1.10:8080/collector
set httpd port 2812 and use address 192.168.1.101
allow localhost
allow 192.168.1.10
allow admin:secret

Assume we have the machines above where M/Monit runs on 192.168.1.10 and listen on port 8080. And Monit runs on 192.168.1.101
and listen on port 2812.

if both are running on the same server then both all the three IP's will be same are you can you can use 127.0.0.1

Note:ISSUE
if you are working on cloud servers they are using private IP addresses, by attempting your server primary live IP you would never going to successfully connect both the servers.

For that you have to ask your service porvider if you don't know your server secondry IP address which is the Private IP. and Put the Private IP Address in line number 2 of the above 6 steps.

In Line 3 put the name of your server serverweb in place of IP address.

Then allow your live IP address to connect through.

8: if you have a firewall then you also have to permit access for port 80 and port 2812 by creating policy, otherwise you will be unable to access your application

9: if you have more than 20 hosts to monitor through M/Monit then you have to change the default sqlite database to Postgresql or Mysql.

setps are listed here but i am using sqlite because i am monitoring not that much hosts.
Setting up M/Monit to use either MySQL or PostgreSQL is a simple two step process:

step-1:Create the M/Monit database. The database schemas can be found in mmonit/db/ Use one of the following recipes:

MySQL:
1) Create the mmonit database: mysqladmin create mmonit -u root -p
2) Create the mmonit user and grant access to the mmonit database:
GRANT ALL ON mmonit.* to mmonit@localhost identified by ''
3) Create the schema: mysql -u mmonit mmonit -p < mmonit-schema.mysql PostgreSQL: 1) Create a mmonit postgres user: createuser -U postgres -P mmonit 2) Create the mmonit database: createdb -U postgres -E utf8 -O mmonit mmonit 3) Create the schema: psql -U mmonit mmonit < mmonit-schema.postgresql step-2:Configure M/Monit; edit the M/Monit configuration file mmonit/conf/server.xml and replace the SQLite element with either.

This one for MySQL:


Or this one for PostgreSQL:


That is it. When you start M/Monit it connects to the configured database system.

10: After Completing this Exercise restart you monit server

/etc/init.d/monit restart

11: Check from log the successful connectivity with MMonit server.

12: open your browser and access the link http://www.serverweb.com:8080

username:admin
password: as listed in M/Monit installation

you will see the dashboard with your host server statistics.

That's all about the M/Monit.

Regards & Thanks
Imran Ullah

No comments:

Post a Comment