-
Incident report
-
Resolution: Declined
-
Trivial
-
None
-
5.0.2
-
None
-
Zabbix 5.0.2
Steps to reproduce:
Using template "Template Module Linux filesystems by Zabbix agent active" from Zabbix 5.0.2
Add a tag like "fsname={#FSNAME}" to trigger "FS: {#FSNAME}: Disk space is critically low (used > {$VFS.FS.PUSED.MAX.CRIT:"
{#FSNAME}"}%)"
Change {$VFS.FS.PUSED.MAX.CRIT} in order the generate a problem.
Go to a problem view, select the host where the problem is and select "Show tags" to 1 and "Tag Name" to "Full"
Result:
preg_match(): Unknown modifier 'r' [zabbix.php:21 → require_once() → ZBase->run() → ZBase->processRequest() → CController->run() → CControllerWidgetProblemsView->doAction() → CScreenProblem::makeData() → CMacrosResolverHelper::resolveTriggerExpressions() → CMacrosResolver->resolveTriggerExpressions() → CMacrosResolverGeneral->getUserMacros() → CMacrosResolverGeneral->getHostUserMacros() → CMacrosResolverGeneral->getHostUserMacros() → preg_match() in include/classes/macros/CMacrosResolverGeneral.php:1217]
Expected:
Line 1217 and in other places for tags should handle "/" chars from tag value, escaping it
if (preg_match('/'.trim($regex, '/').'/', $context) === 1)
/var/log is trimed but still has a "/" and it may affect the preg_match.