Created attachment 1225274 [details] notifier settings Description of problem: I configured set of alerts and disabled "Notifier". after some hours I plan to receive notifications. But suddenly spamming my inbox with email notifications for past alerts/notifications. If user configured lot of alerts with email notification and Turn OFF "Notifier" for some months and he turns ON it again. He will receive tons of email notifications. Version-Release number of selected component (if applicable): Version: 5.7.0.12-rc2.20161123111642_a4a65ce Server Name: EVM User Name: Administrator User Role: EvmRole-super_administrator Browser: Firefox Browser Version: 50 Browser OS: Linux How reproducible: 100% Steps to Reproduce: 1. Disable(Turn OFF) "Notifier", (Configurations >> Settings Server >> Server Control >> Notifier) 2. Configure set of alerts with email notifications with 1 minute "Notification Frequency". These alert should generate notifications. 3. Wait for few hours 4. Enable(Turn ON) "Notifier", (Configurations >> Settings Server >> Server Control >> Notifier) 5. check email inbox, with in few minutes my inbox filled with lot of old/past notifications. Actual results: Sending old/past email notifications when I turn ON "Notifier". This action leads spamming my inbox. Expected results: Should send from the time when I enable "Notifier" Additional info: Screen shot are attached.
Created attachment 1225275 [details] email inbox
Assigning over to Appliance for review. After discussion with Jason the thinking was if the Notifier is disabled, we just don't queue the item. It would seem useful to support an override flag (like :force => true) for cases were we want to queue an item anyway.
https://github.com/ManageIQ/manageiq/pull/14801
Milan, thinking this is a good candidate for an automated test
Checked in 5.9.0.5, I noticed that I still received an e-mail when I had the notifier off for ~30 minutes during and after triggering the alert, then turning it on. The alert I used was hooked to the Tag Complete on provider, notification period every minute.
Milan, would you be able to provide logs form your test? Was there only a single appliance running it the region or were there other appliance that could have potentially had the role enabled? If you no longer have the logs, perhaps you can recreate and give me access to the environment.
I am pretty sure it was a single appliance. The environment is dead by now, I will try recreating, reproducing and eventually passing the details to you.
So, reproduction details from my last try: Version 5.9.0.9 1) Have a fresh appliance 2) In Settings, verify that you can send emails, save the settings 3) Also in Settings, disable the Notifier role, save the settigns. 4) Add a provider, I used a vSphere infra provider 5) Create an alert: Active: Yes Severity: Warning Based On: Provider What to Evaluate: Nothing Driving Event: Compliance: Provider Compliance Passed Notification Frequency: 1 Minute Send E-mail: To: <your email> 6) Put the alert into an alert profile 7) Assign the alert profile to the provider 8) Create a very simple tag-based provider compliance policy: NOT( Tag cost center: Cost Center 001 ) so it always passes the compliance, just make sure the tag is not applied 9) Put the compliance policy into a new policy profile 10) Assign the policy profile to the provider 11) Now, assuming the Notifier is off, go to the provider summary and kick off compliance check from the Policy dropdown 12) Wait a minute or two and repeat 11. Repeat this a couple of times. It does not have any visual indication of the compliance. 13) Wait ~5 minutes and go enable the notifier role. Go refresh your inbox a couple of times. 14) Congratulations, you have just received some spam ... I was wondering, does it need significantly more of the time? But https://github.com/ManageIQ/manageiq/pull/14801/files#diff-eeab7270023711cd8c4963ecafe0af0bR51 looks like that should not be a problem ...