Important notices
Before you add a new report, we ask you kindly to acknowledge the following:
[x] I have read the contributing guide lines at https://github.com/opnsense/plugins/blob/master/CONTRIBUTING.md
[x] I have searched the existing issues and I'm convinced that mine is new.
[x] When the request is meant for an existing plugin, I've added its name to the title.
Is your feature request related to a problem? Please describe.
No.
Describe the solution you'd like
It would be nice if it would be possible to enable email-notifications about power-failures directly in the plugin-gui.
Maybe also to configure the notify-flags for special events (Online,Offline,Lowbatt,Shutdown...) in the GUI.
Describe alternatives you've considered
An alternative could be to integrate it into Monit somehow.
Additional context
-
Is this possible within NUT when just using config files? Otherwise you could watch the log via monit
@mimugmail I think so, except the mailer-part. See here: https://freekode.org/nut-sending-emails/
Are we allowed to vote for these requests?
I would also like the ability to enable email notification from the plugin UI. I am not much of a programmer, but I could envision using the same technique you used for adding user-specified options for the ups.conf file. From ups.conf
{% if helpers.exists('OPNsense.Nut.usbhid.args') and OPNsense.Nut.usbhid.args != '' %}
{% for args in OPNsense.Nut.usbhid.args.split(',') %}
{{ args }}
{% endfor %}
{% endif %}
Add a helper such as OPNsense.Nut.upsmonconf.args and then in the UI a user could add something like (taken from AndyX90's freekode.org reference above):
NOTIFYCMD "/usr/local/etc/nut/notifycmd", NOTIFYFLAG ONLINE SYSLOG, NOTIFYFLAG ONBATT SYSLOG, NOTIFYFLAG LOWBATT SYSLOG+EXEC, NOTIFYFLAG FSD SYSLOG+EXEC
which would be appended to /usr/local/etc/upsmon.conf as:
NOTIFYCMD "/usr/local/etc/nut/notifycmd"
NOTIFYFLAG ONLINE SYSLOG
NOTIFYFLAG ONBATT SYSLOG
NOTIFYFLAG LOWBATT SYSLOG+EXEC
NOTIFYFLAG FSD SYSLOG+EXEC
PS: plugins/sysutils/nut already for some reason includes an example upsmon.conf.samples file that has a similar example inside.
Thanks for your consideration.
I think I can add this on Friday
Hello mimugmail. Any updates on this?
Slipped trough, sorry, I started a new branch for testing ... https://github.com/mimugmail/plugins/tree/patch-30
Most helpful comment
I think I can add this on Friday