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

apt install mariadb-server mariadb-client
systemctl start mariadb
systemctl status mariadb
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 Starting M/Monit...
/root/mmonit/bin/mmonit && echo done

#fails rc.local donno why
#pgrep -a mmonit
#netstat -antupe --inet --inet6 | grep mmonit

chmod +x /etc/rc.local
/etc/rc.local

ready to go

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

"admin" with password "swordfish"

references