Archive > 20.1 Legacy Series

Monit examples

(1/2) > >>

Callahan:
Hi,

I'd like to start using Monit but I'm really struggling to find good examples and walkthroughs to explain in detail how the components plug together. Granted, there is the FTP server restart example here: https://docs.opnsense.org/manual/monit.html but that only addresses restarting a failed service on OPNSense.

My initial requirement was that I wanted to monitor if a VPN had gone down and alert me via email if it had. I managed to find an official script that seems to do the job here: https://github.com/opnsense/core/pull/3025/files which I guessed I had to set up as a Custom Service Setting pointing to that script within OPNSense with a Test Setting of "ChangedStatus" (no idea if that's right as there is no guidance anywhere). Having done that, I now see it in the Monit Status page stating that the status is "OK". I'm not sure what exactly is "OK" as I've not asked it to monitor any gateway yet as far as I can tell.

The Service Test Settings for "ChangedStatus" are already configured to "Alert" so I assumed it would then pass it to the Alert stage and fire off an alert to the email address I have configured in my one and only alert (and yes, I have configured my email relay agent in the General tab and also set it up and tested it with Sensei so I know it's working).

Within the Alert config I have a drop down box of Events. I have no idea where these are pulled from. For example, there is an option in the Events drop-down for "Connection Failed" which its name would suggest is what I need but ultimately, I'm just blindly clicking on options hoping I'll get lucky (*I didn't get lucky...).

I'm sure those of you that have experience with Monit outside of OPNSense and have been tinkering for a while might think these questions are a bit amateur but coming into it blind, it is really not clear which options are supposed to tied to which component.

Thanks.

mimugmail:
https://github.com/opnsense/docs/pull/253

Callahan:
Awesome, thanks.

Callahan:
Spoke too soon. While the Service Tests Setting will apply, trying to apply the given "Service Settings" prevents me form applying the config. No error, no warning, just won't apply.

mimugmail:
Screenshots please

Navigation

[0] Message Index

[#] Next page

Go to full version