OPNsense Forum

Archive => 17.7 Legacy Series => Topic started by: circlenaut on January 31, 2018, 03:51:48 pm

Title: Monit Plugin E-mail Notification
Post by: circlenaut on January 31, 2018, 03:51:48 pm
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.

(https://preview.ibb.co/iMFUpR/opnsense_monit_config.png) (https://ibb.co/kQitG6)

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?
Title: Re: Monit Plugin E-mail Notification
Post by: slackadelic on January 31, 2018, 03:54:14 pm
Sounds like a GUI API audit issue for the field itself... not really the plugin itself.  Don't quote me on that :)
Title: Re: Monit Plugin E-mail Notification
Post by: circlenaut on February 01, 2018, 08:46:32 pm
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?
Title: Re: Monit Plugin E-mail Notification
Post by: faunsen on February 08, 2018, 11:22:01 am
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  :)
Title: Re: Monit Plugin E-mail Notification
Post by: elektroinside on February 12, 2018, 07:56:25 am
If it's possible, please update the plugin to accept & work with hostnames.
Many thanks :)
Title: Re: Monit Plugin E-mail Notification
Post by: circlenaut on April 09, 2018, 08:55:13 pm
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
Title: Re: Monit Plugin E-mail Notification
Post by: faunsen on April 10, 2018, 09:43:51 am
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.