Setting up M/Monit

installing mmonit

fetch the latest M/Monit binary,

cd ~/
wget https://mmonit.com/dist/mmonit-3.7.1-linux-x64.tar.gz
tar xzf mmonit-3.7.1-linux-x64.tar.gz
ln -s mmonit-3.7.1 mmonit

preparing the DB

Either use the Ubuntu packaged binaries or register to MariaDB official repo.

apt install mariadb-server mariadb-client
/etc/init.d/mysql status #this is not SystemD
mysql_secure_installation
mysql -uroot -p

create database mmonit;
grant all on mmonit.* to mmonit@localhost identified by 'DBPASS';
^D

cd ~/mmonit/
mysql -u mmonit mmonit -p < db/mmonit-schema.mysql

setting up mmonit

Switch from SQLite to MariaDB/MySQL,

cd ~/mmonit/conf/
cp -i server.xml server.xml.dist
vi server.xml

       <Realm url="mysql://mmonit:DBPASS@mariadbprod:3306/mmonit"
              minConnections="5"
              maxConnections="25"
              reapConnections="300" />

Enable the daemon at boot time and start it,

vi /etc/rc.local

echo -n mmonit...
/root/mmonit/bin/mmonit && echo done
ps auxfw | grep monit
netstat -antupe --inet --inet6 | grep LISTEN | egrep -v '127.0.0.1|::1'

Note. on Ubuntu, /etc/rc.local is already executable by default

ready to go

http://mmonit:8080/
https://mmonit:84XX/

"admin" with password "swordfish"

references