auanasgheps / snapraid-aio-script

The definitive all-in-one SnapRAID script on Linux. Diff, sync, scrub are things of the past. Manage SnapRAID and much, much more!
GNU General Public License v3.0
231 stars 37 forks source link

Send various things to webhooks #50

Closed Toucan-Sam closed 1 year ago

Toucan-Sam commented 1 year ago

Script is great. Would love to see the ability to push things like snapraid status or snapraid smart or some form of summary to the webhooks, particularly on a fail.

Generally I don't want many notifications, but getting a Telegram or Discord message/summary when something failed would be excellent.

"SnapRAID Script Job started" just tells you that it did in fact start, which isn't particularly valuable.

auanasgheps commented 1 year ago

Hi, what you're asking is definitely possible, please provide some additional details.

We can surely post snapraid status and snapraid smart to Notifications/Webhooks. I would add for each of them an option to enable the notification. However, please note that it would be sent every time the script is run, so I could become a bit spammy.

Also based on the feedback from #49 I will improve Notifications/Webhooks information when something BAD happens, like SYNC/SCRUB job did not complete successfully.

dm9tr0 commented 1 year ago

Also, would be great to add emojis, notification could be much readable image

About '"SnapRAID Script Job started" ' I suppose it is redundant information, for example in this time some other notification can be send by server and you have:

"SnapRAID Script Job started" 
"Some notification 1"
...
"Some notification n"
[WARNING] - Unable to continue with SYNC/SCRUB job(s)

And you have to guessing is it script notification or something else. Would be better to send only one message OR somehow distinguish that SnapRAID Script Job started and [WARNING] - Unable to continue with SYNC/SCRUB job(s) it is related to one script execution, easiest way - to add some icon in the beginning.

Toucan-Sam commented 1 year ago

Also based on the feedback from #49 I will improve Notifications/Webhooks information when something BAD happens, like SYNC/SCRUB job did not complete successfully.

This is probably the more useful of the things. I don't necessarily need the other information in the webhook. I just want to know when something bad happens so that I can take an action.

We can surely post snapraid status and snapraid smart to Notifications/Webhooks. I would add for each of them an option to enable the notification. However, please note that it would be sent every time the script is run, so I could become a bit spammy.

100% fine. SENDSNAPSTATUS=0, SENDSNAPSMART=1. Doesn't have to be massively well formatted or anything. Just nice to have the option. Ultimately it's the 'something bad has happened'... or about to happen... that I'm looking for.

firasdib commented 1 year ago

Has there been any progress on this?

auanasgheps commented 1 year ago

@firasdib after a long time I finally have some time to spend to make these changes!

firasdib commented 1 year ago

Yay! Can’t wait to try things out :-)Vänliga hälsningar / Best regards,Firas DibOn 19 Jul 2023, at 10:21, Oliver Cervera @.***> wrote: @firasdib after a long time I finally have some time to spend to make these changes!

—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you were mentioned.Message ID: @.***>

auanasgheps commented 1 year ago

The code is rough, but it's coming together.

Unfortunately these tables aren't rendered well, this is a snapraid limitation: the best I can do is shown here, they are wrapped as code.

In the email body they have a better look, though.

image image

auanasgheps commented 1 year ago

Hey there, just pushed the changes! If you fancy, you can quickly try the dev branch, but do not use it in production yet.