Monit Service won't start

Started by opnsenseuser, June 18, 2025, 04:48:55 PM

Previous topic - Next topic
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é
Supermicro A2SDi-4C-HLN4F
Team Rebellion Member (sidebar / themes: tukan, cicada & vicuna)

Show your generated config, possibly?
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

June 18, 2025, 09:29:29 PM #2 Last Edit: June 18, 2025, 09:31:02 PM by opnsenseuser
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.
Supermicro A2SDi-4C-HLN4F
Team Rebellion Member (sidebar / themes: tukan, cicada & vicuna)

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.
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

please check /usr/local/etc/monitrc

June 19, 2025, 06:21:46 AM #5 Last Edit: June 19, 2025, 06:58:28 AM by opnsenseuser
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?
Supermicro A2SDi-4C-HLN4F
Team Rebellion Member (sidebar / themes: tukan, cicada & vicuna)

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
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

Thx. I will Look at this.
Supermicro A2SDi-4C-HLN4F
Team Rebellion Member (sidebar / themes: tukan, cicada & vicuna)

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.
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

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.
Supermicro A2SDi-4C-HLN4F
Team Rebellion Member (sidebar / themes: tukan, cicada & vicuna)

June 19, 2025, 09:25:36 AM #10 Last Edit: June 19, 2025, 09:28:51 AM by opnsenseuser
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.
Supermicro A2SDi-4C-HLN4F
Team Rebellion Member (sidebar / themes: tukan, cicada & vicuna)

i deleted the whole text and made a new text. but it doesn´t work
Supermicro A2SDi-4C-HLN4F
Team Rebellion Member (sidebar / themes: tukan, cicada & vicuna)

June 19, 2025, 09:35:03 AM #12 Last Edit: June 19, 2025, 09:37:14 AM by Patrick M. Hausen
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.
Deciso DEC750
People who think they know everything are a great annoyance to those of us who do. (Isaac Asimov)

so i changed it like it will be shown in the info text. but this doesn´t work either.
Supermicro A2SDi-4C-HLN4F
Team Rebellion Member (sidebar / themes: tukan, cicada & vicuna)

June 19, 2025, 09:51:03 AM #14 Last Edit: June 19, 2025, 09:53:22 AM by opnsenseuser
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
Supermicro A2SDi-4C-HLN4F
Team Rebellion Member (sidebar / themes: tukan, cicada & vicuna)