What is Monit?
Monit is a utility for managing and monitoring processes, programs, files, directories and filesystems on a Unix system.
Node and Pillar operators can use Monit to monitor memory usage and use it to restart go-zenon
when the host memory usage exceeds a certain percent. This is especially useful if you are running an orchestrator on your Pillar. The orchestrator requires a valid go-zenon
node and when the node goes offline the orchestrator will fail.
If you restart your node or pillar with a cron job, consider implementing monit to reduce the restarts. This will make the node more stable and will help with the operation of the orchestrator.
Step 1 - Install Monit
sudo apt install monit
Step 2 - Create a monit file to monitor host memory usage
sudo nano /etc/monit/conf-available/host
Paste the following content into the host
file
check system $HOST
# if loadavg (5min) > 3 then alert
# if loadavg (15min) > 1 then alert
if memory usage > 70% for 1 cycles then exec "/usr/bin/systemctl restart go-zenon"
Step 3 - Activate the host
monitoring configuration
ln -s /etc/monit/conf-available/host /etc/monit/conf-enabled
Step 4 - Reload Monit to Activate memory monitoring
monit reload
Step 5 - Check to make sure Monit is running properly
sudo systemctl status monit