Uploaded image for project: 'ZABBIX BUGS AND ISSUES'
  1. ZABBIX BUGS AND ISSUES
  2. ZBX-18208

Problems view when tags value contains / (such as filesystem name)

XMLWordPrintable

    • Icon: Incident report Incident report
    • Resolution: Declined
    • Icon: Trivial Trivial
    • None
    • 5.0.2
    • Frontend (F)
    • 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.

       

            zabbix.support Zabbix Support Team
            GuiGuiGui GuiGuiGui
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: