For some time now, I've been having the problem that the Monit Service won't start. The log shows the following:
Quote/usr/local/etc/monitrc:14: syntax error 'Das'
Any ideas?
Regards rené
Show your generated config, possibly?
What config do you mean? Monit config?
The problem is, i can´t apply the settings.
I can only do this when disable the monit service.
The config file generated by the UI seems to have a syntax error. You need to find that config file - via SSH/CLI - and investigate. I don't run monit, so I have no idea where the plugin keeps it.
please check /usr/local/etc/monitrc
monitrc:
Quote# DO NOT EDIT THIS FILE -- OPNsense auto-generated file
set httpd unixsocket /var/run/monit.sock
allow localhost
set daemon 120 with start delay 120
set logfile syslog facility log_daemon
set mailserver 127.0.0.1 port 25
set alert mail@mymail.com { connection,data,permission } mail-format { Das $SERVICE auf $HOST ist fehlgeschlagen. }
include /usr/local/etc/monit.opnsense.d/*.conf
i also reinstalled the monit package. but doesn´t fix the problem either.
Maybe there is something wrong with the core package?
Not a problem with the package - your mail-format is wrong. That's why it's complaining about "Das". Broken config file --> no startup.
See the monit documentation for what mail-format must look like:
https://mmonit.com/monit/documentation/monit.html#Message-format
Thx. I will Look at this.
Quote from: cookiemonster on June 18, 2025, 11:17:00 PMplease check /usr/local/etc/monitrc
The path was in the error message - how could I overlook that? Thanks.
but i can´t see any problems. i didn´t change anything in the monitrc file itself. this is all generated by opnsense via gui.
and the syntax is right.
if i delete the word "Das" in the settings of monit the error message changes from "Das" to
Quote2025-06-19T09:23:47 Error monit monit exiting due to parsing errors in the configuration file.
2025-06-19T09:23:47 Error monit /usr/local/etc/monitrc:14: syntax error '$SERVICE'
The text in the Mail Format field was automatically generated by Opnsense. I never changed anything here.
i deleted the whole text and made a new text. but it doesn´t work
You cannot enter just text there. See the linked documentation. You must use the format specified:
from: Monit Support <monit@foo.bar>
reply-to: support@domain.com
subject: $SERVICE $EVENT at $DATE
message: Monit $ACTION $SERVICE at $DATE on $HOST: $DESCRIPTION.
Yours sincerely,
monit
So at the very least add the "message:" keyword.
so i changed it like it will be shown in the info text. but this doesn´t work either.
At least the service is back up and running. Still,
I find it strange, since I never changed anything here.
Now i get failed to load widget. Deleted the widget and readded it. but still get the failed message.
strange