AnalogJ / scrutiny

Hard Drive S.M.A.R.T Monitoring, Historical Trends & Real World Failure Thresholds
MIT License
5.13k stars 167 forks source link

[FEAT] Notify on Critical Only #300

Closed jimmybrancaccio closed 2 years ago

jimmybrancaccio commented 2 years ago

Is your feature request related to a problem? Please describe.

I only have 3 servers added to my Scrutiny instance with a collective 22 drives and I get at least 20 emails per day about various drives in failing states. It's been about 2 weeks since I've had Scrutiny running but I'm at notification overload and at this point I just delete all the emails.

Describe the solution you'd like

To assist with this would it be possible to implement a feature that sends notification on when a critical measurement is failing? For example just notify on these measurements:

scrutiny

Additional context

N/A

AnalogJ commented 2 years ago

oh this is definitely a good quality of life feature. I'll definitely add support for filtering notification triggers.

AnalogJ commented 2 years ago

I'm playing around with a couple of different config file syntax options, but I think something like this might make sense:

notify:
  urls:
    - "discord://token@channel"
    - "telegram://token@telegram?channels=channel-1[,channel-2,...]"
    - "pushover://shoutrrr:apiToken@userKey/?priority=1&devices=device1[,device2, ...]"
    ...
  filter_attributes: 'all' # options: 'all' or  'critical'
  level: 'fail' # options: 'fail', 'fail_scrutiny', 'fail_smart'

@jimmybrancaccio @gofaster What do you think?

jimmybrancaccio commented 2 years ago

@AnalogJ Yeah, I like that! It makes sense and would definitely meet my need here.

On a side note, I like how that implementation applies specifically to notifications. A similar method could be used to apply it to the web interface as well ☺️ I planned on opening another feature request to address that, just haven't had a moment yet.

gofaster commented 2 years ago

@AnalogJ Those filter criteria look great. They provide helpful granularity without getting too complicated.

AnalogJ commented 2 years ago

@jimmybrancaccio @gofaster thanks for the feedback!

@jimmybrancaccio there's already an issue tracking the WebUI work in https://github.com/AnalogJ/scrutiny/issues/275

AnalogJ commented 2 years ago

This notification filtering code is now available in the beta branch (and can be tested by using the beta-omnibus docker image tag).

@jimmybrancaccio @gofaster Can you try it out and get back to me? (once the docker images finish builing: https://github.com/AnalogJ/scrutiny/actions/runs/2529933463)

Thanks!

jimmybrancaccio commented 2 years ago

Hey @AnalogJ! I apologize for the delay in response - crazy busy week. That said, is it safe to assume the beta-web and beta-collector images would have this in them (I use the hub/spoke method). If so, I'll update and let you know ASAP! Thank you!

AnalogJ commented 2 years ago

@jimmybrancaccio correct, the beta-* images have the fix.

jimmybrancaccio commented 2 years ago

I just wanted to quick report back that I do believe it worked. I didn't get a zillion emails overnight πŸ˜‚

Thank you @AnalogJ for hopping on this so quickly and getting the functionality added!

AnalogJ commented 2 years ago

Great, thanks @jimmybrancaccio !

AnalogJ commented 2 years ago

FYI @jimmybrancaccio @gofaster The notify.filter_attributes and notify.level options in the config file will be removed in v0.5.0 and replaced by settings stored in the database.

When #352 is released, scrutiny will throw an error during startup stating that those keys must be removed from the config file.

Sorry about that -- I'm consolidating all the settings in the database (finally) and rolling out the changes to the frontend (as we discussed).

Appreciate your understanding

jimmybrancaccio commented 2 years ago

@AnalogJ Not a problem at all! Thank you very much for giving a heads up! πŸ’™

AnalogJ commented 2 years ago

FYI, v0.5.0 has been released, and notify.filter_attributes and notify.level have been removed.