Skip to content

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