-
-
Notifications
You must be signed in to change notification settings - Fork 427
Description
I have been wondering why my perl regexp like 'Aruba.*Switch' in the "System Description Match" field of the automation templates don't work, until I have found this:
https://github.com/Cacti/cacti/blob/master/lib/api_automation.php#L3071-L3073
Syntax of MariaDB REGEXP according to https://mariadb.com/kb/en/regexp/ is expr REGEXP pat or expr RLIKE pat, i.e. the pattern is after the REGEXP keyword not before, similar to the SQL LIKE.
Thus sysDescr REGEXP "(' . preg_quote($qsysDescr) . ')" actually matches whatever has been entered into the match field with the regexp in the text read into the snmp description. Obviously that doesn't match. So basically parameters to the REGEXP are swapped. They should be in the same order as for the LIKE part: first the text to be checked, then the pattern to be used.
Running 1.2.25 from EPEL9 on AlmaLinux 9.