Monit Plugin E-mail Notification

Started by circlenaut, January 31, 2018, 03:51:48 PM

Previous topic - Next topic
I'm having a hard time getting monit to send email notifications on alert. I've setup system notifications and that works ok. Attached is the monit settings page.



I tried filling in the same smtp server, auth, and password that works for system notifications but when I hit apply, I get prompted with a "smtp server must be an IP address." I don't understand why it needs to be an IP address? Monit docs allow for FQDN. Is this a bug?

Sounds like a GUI API audit issue for the field itself... not really the plugin itself.  Don't quote me on that :)

Hmm, apparently the monit plugin should pull the settings from notifications. I think because I had monit installed before I set my notifications it didn't pull correctly. How do I completely remove a plugin and it's settings?

Simply removing and installing the plugin doesn't work. It reverts to my previous settings. Where are the config files located so I can delete them?

Monit imports the notification settings only on install and only if you have no Monit config from a previous install.

To remove the plugin and it's configuration uninstall it and create a backup of the OPNsense config.
Edit the backup XML and remove the <monit> section. Then restore it.
Please test this procedure before doing this on a production system.  ;)

The IP restriction comes from the plugin.
I add this to my todo list  :)

If it's possible, please update the plugin to accept & work with hostnames.
Many thanks :)
OPNsense v18 | HW: Gigabyte Z370N-WIFI, i3-8100, 8GB RAM, 60GB SSD, | Controllers: 82575GB-quad, 82574, I221, I219-V | PPPoE: RDS Romania | Down: 980Mbit/s | Up: 500Mbit/s

Team Rebellion Member

The new import settings button works! Thank you.

On another note, I couldn't get it to work with zoho. When sending notifications from the webgui, zoho worked, but not from monit. I switched to gmail mail and both works now.

The error in the log for zoho was:

Mail: Mailserver response error -- 553 Relaying disallowed as monit@subdomina.example.com

Quote from: circlenaut on April 09, 2018, 08:55:13 PM
Mail: Mailserver response error -- 553 Relaying disallowed as monit@subdomina.example.com

A mail server responsible for domain a.com should never relay mails from user1@b.com to user2@c.com.
Probably your sender address monit@subdomina.example.com is wrong. Does the account monit exists at zoho?

Better set it to the mail address of the login username.
You can set it in your Alert Settings.
Add from: user@domain.tld to the Mail format setting.