waa / baculabackupreport

A highly customizable HTML email report for Bacula environments.
BSD 2-Clause "Simplified" License
15 stars 3 forks source link

don't email if all jobs OK #9

Closed dmd closed 1 year ago

dmd commented 1 year ago

Similar to #5, I'd love an option for it to refrain from sending an email if all jobs were OK (that is to say - if it would have used a 'green' status icon in the subject line).

waa commented 1 year ago

Hi Daniel,

Are you asking for the script to not send anything? Not even an empty email with the green icon and "OK" subject line?

I have never really been a fan of only sending monitoring reports when everything is OK.

My reasoning: What if all your jobs are failing, and nothing is being backed up, and also there is a bug in the script which causes it to crash? You never get a report and assume everything is OK, when in fact everything is not OK.

If I come in to work and I do not see a morning report, I know what my first task has just become. :)

In a production environment, I would recommend to send the reports to a ticket system which would decide what to do with the report, and trigger actions if there were issues (ie: assign ticket to worker), or, if the report is good, just close the ticket without triggering any actions.

That being said, implementing your request should be pretty straight forward. Let me see what I can do. :)

Best regards, Bill

dmd commented 1 year ago

In my case, the answer is - if the script doesn't return 0, the && in the crontab won't run, so it won't execute the curl to the https://healthchecks.io/ event. So I will know if it crashed!

waa commented 1 year ago

Ah! OK, so you have this case covered!

Perfect.

I will not work on this today, but it's on my list now.

Thank you for the request and clarification.

dmd commented 1 year ago

Yeah I subscribe to a strict 'dark cockpit' philosophy - if everything is OK, my Zabbix dashboard should be empty and I should not be receiving any emails.

That only works because I have a ton of instrumentation which will fire alerts not only if something's wrong, but also if things that should be reporting in as good fail to report in.

waa commented 1 year ago

I like it. It requires a lot of up-front work, but it significantly cuts down on the noise. :)

I have added this feature tonight.

Closing this issue.

Please re-open or create a new one if this does not work as expected.

waa commented 1 year ago

Oops!

I forgot to mention you will need the new do_not_email_on_all_ok = True set in your config file, command line, or ENV.

:v: