Werk #11975: Validate regexes in BI rules during config update

Komponente Checks und Agenten
Titel Validate regexes in BI rules during config update
Datum 17.02.2021
Checkmk-Editon Checkmk Raw (CRE)
Checkmk-Version 2.1.0i1 2.0.0b7
Level Kleine Änderung
Klasse Neues Feature
Kompatibilität Kompatibel - benötigt kein manuelles Eingreifen

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.

Zur Liste aller Werks