Skip to content

Sharing a few notes on how to quickly set up M/Monit with servers managed through GridPane.

Note: This is a bare-minimum integration and is meant to get a quick install up and running for testing. This post does not go in-depth on how to secure the installation or server in Step 4 below. If you’re not comfortable following the m/monit documentation here, you run the risk of an insecure installation.

1) Spin up a small VPS such as a $5/month droplet at Digital Ocean with Ubuntu x64. Do not connect this server to GridPane. You may want to point a domain or subdomain to this IP address.

2) Connect as root and install m/monit. Check mmonit.com for the latest version number.

cd /etc
wget https://mmonit.com/dist/mmonit-3.7.4_1-linux-x64.tar.gz
tar -xf mmonit-3.7.4_1-linux-x64.tar.gz
mv mmonit-3.7.4_1-linux-x64.tar.gz mmonit
/etc/mmonit/bin/mmonit

3) Load your [server-ip]:8080 in a browser and log in with the default login (admin/swordfish). Go to Admin / Users and create a new primary user with a secure password. Switch to that account and then delete the default Admin user. While on the Users page, change the monit user password as well. (The monit user is a non-admin user which is used to collect data).

4) Now is a good time to change the listening port, hostname, generate an SSL certificate, and disable HTTP access. Refer to the documentation while editing conf/server.xml. You’ll then restart m/monit:

/etc/mmonit/bin/mmonit stop
/etc/mmonit/bin/mmonit start

We used Let’s Encrypt to generate a certificate, however there is a known issue where m/monit looks for a key/certificate format not generated by LE which will need to be addressed (For a workaround you can concatenate privkey.pem and fullchain.pem into a single file). Update the certificate location in conf/server.xml. You can specify the fullchain and privkey paths like this in the conf/server.xml file:


<Host name="mmonit.mydomain.com" appBase="."
certificate="/home/mmonit/letsencrypt/live/mmonit.mydomain.com/fullchain.pem"
certificateKey="/home/mmonit/letsencrypt/live/mmonit.mydomain.com/privkey.pem" >

5) SSH to a GridPane server that you plan to monitor and add a new file at /etc/monit/conf.d/mmonit containing the following, replacing the user, password, IP, and ports for your install (using the non-admin monit user):

set mmonit https://:[password]@[server-ip]:[port]/collector 
set httpd port 2812 
     allow [server-ip]

6) Reload monit on that server:

monit reload

7) Continue for remaining servers. They should all now appear in your m/monit instance.

You may now want to install Ruby and connect to Slack via webhook (Instructions)

Max Elman is Razorfrog's Founder and Project Manager. He is a tech-savvy internet guru and has led Razorfrog's award-winning web design team since 2008. View Max's bio for more details.

Toggle light/dark mode

Back To Top