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

Fix is_enabled not work with reload #3036

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

bincherry
Copy link

fix #1677

  1. Rules with is_enabled: false should alse be loaded, but into disabled_rules[]
  2. When a old rule is loaded with is_enabled: false, it should be remove from scheduler

@bincherry
Copy link
Author

also fix #2893 #2043

tested:

  1. started with empty rules
  2. add role with is_enabled: true
  3. edit that role with is_enabled: false
  4. edit that role with is_enabled: true
INFO:elastalert:Starting up
INFO:elastalert:Disabled rules are: []
INFO:elastalert:Sleeping for 59.999757 seconds
INFO:elastalert:Background configuration change check run at 2020-11-12 01:36 UTC
INFO:elastalert:Background alerts thread 0 pending alerts sent at 2020-11-12 01:36 UTC
INFO:elastalert:Disabled rules are: []
INFO:elastalert:Sleeping for 59.999793 seconds
INFO:elastalert:Background configuration change check run at 2020-11-12 01:37 UTC
INFO:elastalert:Background alerts thread 0 pending alerts sent at 2020-11-12 01:37 UTC
INFO:elastalert:Disabled rules are: []
INFO:elastalert:Sleeping for 59.999792 seconds
INFO:elastalert:Background alerts thread 0 pending alerts sent at 2020-11-12 01:38 UTC
INFO:elastalert:Loaded new rule /opt/rules/aaa.yaml
INFO:elastalert:Background configuration change check run at 2020-11-12 01:38 UTC
INFO:elastalert:Disabled rules are: []
INFO:elastalert:Sleeping for 59.999738 seconds
INFO:elastalert:Queried rule aaa from 2020-11-12 01:33 UTC to 2020-11-12 01:38 UTC: 0 / 0 hits
INFO:elastalert:Ran aaa from 2020-11-12 01:33 UTC to 2020-11-12 01:38 UTC: 0 query hits (0 already seen), 0 matches, 0 alerts sent
INFO:elastalert:Rule file /opt/rules/aaa.yaml is now disabled.
INFO:elastalert:Background configuration change check run at 2020-11-12 01:39 UTC
INFO:elastalert:Background alerts thread 0 pending alerts sent at 2020-11-12 01:39 UTC
INFO:elastalert:Disabled rules are: ['aaa']
INFO:elastalert:Sleeping for 59.999752 seconds
INFO:elastalert:Reloading configuration for rule /opt/rules/aaa.yaml
INFO:elastalert:Background alerts thread 0 pending alerts sent at 2020-11-12 01:40 UTC
INFO:elastalert:Background configuration change check run at 2020-11-12 01:40 UTC
INFO:elastalert:Disabled rules are: []
INFO:elastalert:Sleeping for 59.999739 seconds
INFO:elastalert:Queried rule aaa from 2020-11-12 01:38 UTC to 2020-11-12 01:40 UTC: 0 / 0 hits
INFO:elastalert:Ran aaa from 2020-11-12 01:38 UTC to 2020-11-12 01:40 UTC: 0 query hits (0 already seen), 0 matches, 0 alerts sent

@nsano-rururu
Copy link
Contributor

Merged into elastalert2
jertel/elastalert2#31

@nsano-rururu nsano-rururu mentioned this pull request Sep 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

is_enabled not work with reload.
2 participants