Monit configuration "stuck" needing apply

Started by cpw, January 06, 2021, 03:19:20 PM

Previous topic - Next topic
HHi,
So I tweaked my monit configuration to hopefully monitor dpinger a bit better. The configuration seems to be working, however the monit Web UI is stuck reporting "needs apply". Repeated selection of the button works to generate new config, that is accepted by monit (monit is running with new config), but the button itself never goes away.

configd.log file:

Jan  6 09:08:48 wall configd.py[45684]: [d2cd3e3e-78c4-4c5f-aaee-5ab69ac242bf] get monit status
Jan  6 09:08:48 wall configd.py[45684]: [d4af6713-acf7-4560-bc76-471489360c48] generate template OPNsense/Monit
Jan  6 09:08:48 wall configd.py[45684]: generate template container OPNsense/Monit
Jan  6 09:08:48 wall configd.py[45684]:  OPNsense/Monit generated //usr/local/etc/monitrc
Jan  6 09:08:48 wall configd.py[45684]:  OPNsense/Monit generated //etc/rc.conf.d/monit
Jan  6 09:08:48 wall configd.py[45684]: [ce69a8aa-4936-4ee8-a4d2-446dbb24bc93] testing monit configuration


I can't find any errors anywhere in the log files.

Edit: running latest opnsense regular build with libressl:

OPNsense 20.7.7_1-amd64
FreeBSD 12.1-RELEASE-p11-HBSD
LibreSSL 3.1.5


Just tried adding here on my test routrer, All OK.
OPNsense 24.7 - Qotom Q355G4 - ISP - Squirrel 1Gbps.

Team Rebellion Member

OK. I took a look at the network tracing and I saw that there was a syntax error. Interestingly, monit seems happy with the result as "Control file syntax OK" is also reported.

It looks like the problem is that the monit UI's service test doesn't accept anything other than a single file value for PATH. for an "Execute" action type, even though monit itself is quite happy to accept any quoted string as the action to execute. Looks like it's a missing enhancement request.

https://mmonit.com/monit/documentation/monit.html#SERVICE-TESTS

Quote
EXEC can be used to execute an arbitrary program and send an alert. If you choose this action you must state the program to be executed and if the program requires arguments you must enclose the program and its arguments in a quoted string. You may optionally specify the uid and gid the executed program should switch to upon start. The program is executed only once if the test fails.

Anyway, a small shell script later, and learning monit env variables has fixed the problem. Thanks!

Also, got dpinger restart nicely configured in monit..