Werk #11975: Validate regexes in BI rules during config update
Component | Checks & agents |
Title | Validate regexes in BI rules during config update |
Date | Feb 17, 2021 |
Checkmk Edition | Checkmk Raw (CRE) |
Checkmk Version | 2.0.0b7 2.1.0b1 |
Level | Trivial Change |
Class | New Feature |
Compatibility | Compatible - no manual interaction needed |
Unfortunately Python 2 allowed to enter invalid regexes into arguments of BI rules. In Python 3 these values will lead to a crash when evaluating the service condition. E.g. a argument like "C:\Users\" leads to the error message "re.error: incomplete escape \U at position 2".
Therefore the Checkmk update procedure (cmk-update-config) validates the regular expressions in BI rules and logs "ERROR: Invalid regular expression in BI rule detected" if the regex cannot be evaluated. If you encounter these errors your configuration probably contains rules that needs to be corrected. Previous Checkmk versions were not complaining about those rules but they were not able to match. You should change these rules according to https://docs.checkmk.com/latest/en/regexes.html prior to the update of your production site. E.g. you should change windows paths like "C:\Users\" to "C:\Users\" with double backslashes.