Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notifications should include time stamp in message #1432

Closed
dsm1212 opened this issue Dec 1, 2022 · 5 comments
Closed

Notifications should include time stamp in message #1432

dsm1212 opened this issue Dec 1, 2022 · 5 comments

Comments

@dsm1212
Copy link

dsm1212 commented Dec 1, 2022

This may be outside your control, I'm not sure what you are using to generate the messages.

The UPS shutdown emails sometimes don't get through until after the system is restarted. When received they appear as if they are happening now, not when the shutdown occurred. The text of the message should have the time in it so it is clear that it's an old message. This would probably be good for all notifications in case mail is in delay for other reasons.

@dsm1212 dsm1212 added the feature label Dec 1, 2022
@votdev
Copy link
Member

votdev commented Dec 1, 2022

The email is generated by nut upssched and out of the control of the OMV project.

@votdev votdev closed this as completed Jan 8, 2023
@votdev votdev added upstream issue external issue The problem is beyond the control of the project labels Jan 8, 2023
@PrplHaz4
Copy link

PrplHaz4 commented Jan 8, 2023

It looks like upsmon controls the message and upssched the sending of the notification/email.

Does omv write/overwrite this .conf file? Or, would changing the message upstream even fix it for omv?

https://github.com/networkupstools/nut/blob/master/conf/upsmon.conf.sample.in

@votdev
Copy link
Member

votdev commented Jan 9, 2023

Does omv write/overwrite this .conf file? Or, would changing the message upstream even fix it for omv?

OMV is managing that configuration file, but it does not help to change the notification messages because upsmon does not provide the ability to use a placeholder for the date that will be filled with the current time of the notification at runtime. Only %s will be replaced by the configured UPS name at runtime. If you want that feature this must be implemented by the NUT project, but i fear that it will take ages until this feature appears in the Debian package that can be consumed by OMV finally.

The best is to find out why Postfix does not send the email before the shutdown.

@votdev
Copy link
Member

votdev commented Jan 15, 2023

This could be interested: https://forum.openmediavault.org/index.php?thread/45897-customize-nut-notifications/&postID=335349#post335349

You can customize the OMV_NUT_UPSSCHEDCMD_EMAIL_SUBJECT environment variable. Set it to foo bar - %d %h will produce the email subject foo bar - 15.01.2023 - mynas.local for example.

votdev added a commit that referenced this issue Jan 16, 2023
…ironment variables.

Fixes: #1432

Signed-off-by: Volker Theile <votdev@gmx.de>
@votdev votdev added 6.x and removed upstream issue external issue The problem is beyond the control of the project labels Jan 16, 2023
@dsm1212
Copy link
Author

dsm1212 commented Jan 23, 2023

We just had a brief power outage so I have confirmation the OMV_NUT_UPSSCHEDCMD_EMAIL_SUBJECT including %h showed me the date and time of the event in the subject. Thanks!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants