Contents
Monit
M/Monit
Wiki
Table of Contents
Up and running in 30s or more
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-<version> directory 5. Run M/Monit using: ./bin/mmonit 6. Point your Browser to http://localhost:8080/ and login as user admin with password swordfish.
Once started, mmonit will daemonize itself and run in the background. To stop mmonit use ./bin/mmonit stop. To see all options for the mmonit program use ./bin/mmonit -h.
You can run mmonit as any user, including root. It is not necessary to create a standalone account to run mmonit.
Database setup
M/Monit comes bundled and configured with SQLite as its database system. No extra setup is required. If you plan to use M/Monit to monitor more than, say 20-30 hosts, you may want to use MySQL or PostgreSQL instead as these database systems are faster and scale much better. If in doubt, start with SQLite. If you later should want to switch, you can use the migrate script in the upgrade directory to move your SQLite data over to MySQL or PostgreSQL.
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 '<password>'
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 <Realm> element with either:
This one for MySQL:
<Realm url="mysql://mmonit:mmonit@127.0.0.1:3306/mmonit"
minConnections="5"
maxConnections="30"
reapConnections="300" />
Or this one for PostgreSQL:
<Realm url="postgresql://mmonit:mmonit@127.0.0.1:5432/mmonit"
minConnections="5"
maxConnections="30"
reapConnections="300" />
Adjust username, password, host and port number in the connection URL as required.
The URL in the <Realm> element specify a database connection on the standard URL format. The format of the connection URL is defined as: database://[user:password@][host][:port]/database[?propertyName1][=propertyValue1][&propertyName2][=propertyValue2]... The property names user and password are always recognized and specify how to login to the database. Other properties depends on the database server in question. User name and password can alternatively be specified in the auth-part of the URL. If port number is omitted, the default port number for the database server is used.
That is it. When you start M/Monit it connects to the configured database system.