Monit no longer starts

Started by Taomyn, July 26, 2020, 11:37:08 AM

Previous topic - Next topic
So I don't need the entry I have for my firewall in the service settings section? Service Test Settings should take care of it as they are all there as you state?

You need both.  The actual tests are in Service Test Settings.  The service is set up in Service Settings.

When setting up a 'service', the 'tests' are selected with the drop down box in Service Settings.

Don't modify the 'tests' in Service Test Settings, unless you have read the Monit Manual.

Don't select the 'ChangedStatus' test for the 'Host' service in Service Settings.  As you have found out, it won't work.

Seems the GUI is majorly broken because everything was fine with this config before 20.1.9


I tried to add some entries, I got as far as CPUUsage and MemoryUsage, but trying to add SpaceUsage brings back the problem.

I still get this error: /usr/local/etc/monitrc:14: syntax error 'mail-format'

OPNsense 20.7.7_1-amd64

Any solution? Thanks.

Just look at the file and google the correct syntax , maybe also in man page. Sometimes it's only a missing space

QuoteI still get this error: /usr/local/etc/monitrc:14: syntax error 'mail-format'
whats in the "mail format" option of alert settings?

The web GUI will let you enter settings that don't actually match each other - and then Monit won't work.

You definitely cannot adjust the web settings without reading the Monit manual.  I've learned that myself the hard way.  It's also best to look at the file at /usr/local/monitrc and make sure it matches what is shown in the Monit manual.

Here is part of my Monit file (The rest is custom alert scripts of my own making):


set daemon 120 with start delay 120

set logfile syslog facility log_daemon



set mailserver mydomain.com port 25   

set alert user@mydomain.com   mail-format { from: opnsense_box@mydomain.com } reminder on 10 cycles

check system $HOST
   if memory usage is greater than 75% then alert
   if cpu usage is greater than 75% then alert
   if loadavg (1min) is greater than 8 then alert
   if loadavg (5min) is greater than 6 then alert

check filesystem RootFs with path "/"
   if space usage is greater than 75% then alert


Line 14 (your error line) starts with 'set alert... mail format...'

December 23, 2020, 11:58:58 AM #22 Last Edit: December 23, 2020, 12:12:39 PM by tam
Quote from: Fright on December 22, 2020, 06:22:51 PM
whats in the "mail format" option of alert settings?

Subject: $SERVICE on $HOST failed

Fixed my error now by changing the event in the alerts settings. Thanks for the hints.