Ad Widget

Collapse

Returning preg_match() error, incorrect trigger function

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • marvel
    Junior Member
    • Aug 2012
    • 1

    #1

    Returning preg_match() error, incorrect trigger function

    Hello,

    When I try to create a trigger with this expression:
    {myhostname:vfs.fs.size[c:,free].last(0)}<1500000000

    it gives the following errors:
    preg_match(): Compilation failed: unknown option bit(s) set at offset 0 [api/classes/CTriggerExpression.php:93]
    Incorrect trigger function "last(0)" provided in expression. Incorrect function format. Check expression part starting from "{myhostname:vfs.fs.size[c:,free].last(0)}<1500000000".

    I'm using Zabbix 2.0.2. Only thing that has recently changed is PHP which was upgraded to version 5.3.14. Dont even know if thats related to this problem though.

    The expression seems to be okay and has worked before (in 1.8).

    Anyone any ideas?
    Thanks!
  • newtozabbix
    Junior Member
    • Aug 2012
    • 2

    #2
    DId you find a solution to this problem?

    I am new to Zabbix and I am stuck at this point too. I see the same error as you. Were you able to solve this?

    Let me know.
    Thanks in advance.





    Originally posted by marvel
    Hello,

    When I try to create a trigger with this expression:
    {myhostname:vfs.fs.size[c:,free].last(0)}<1500000000

    it gives the following errors:
    preg_match(): Compilation failed: unknown option bit(s) set at offset 0 [api/classes/CTriggerExpression.php:93]
    Incorrect trigger function "last(0)" provided in expression. Incorrect function format. Check expression part starting from "{myhostname:vfs.fs.size[c:,free].last(0)}<1500000000".

    I'm using Zabbix 2.0.2. Only thing that has recently changed is PHP which was upgraded to version 5.3.14. Dont even know if thats related to this problem though.

    The expression seems to be okay and has worked before (in 1.8).

    Anyone any ideas?
    Thanks!

    Comment

    • jpastuszek
      Junior Member
      • Sep 2012
      • 2

      #3
      Same problem here

      I have upgraded from 2.0.0 to 2.0.2 and it looks like I can't create any trigger:

      preg_match(): Compilation failed: unknown option bit(s) set at offset 0 [api/classes/CTriggerExpression.php:93]
      Incorrect trigger function "last(0)" provided in expression. Incorrect function format. Check expression part starting from "{Template WCC Cache:varnish[n_ban].last(0)}#666".

      Please help.

      Comment

      • jpastuszek
        Junior Member
        • Sep 2012
        • 2

        #4
        PHP-PRCE UTF-8 support issue

        Looks like the problem is /u regex flag (in few PHP file in zabbix).
        I still need to fix the root problem but getting rid of /u allowed me to create the trigger.

        This will probably brake zabbix but here are commands to get rid of all /u flags in regex:

        sed 's,/u",/",g' -i include/triggers.inc.php
        sed "s,/u',/',g" -i api/classes/CWebCheck.php api/classes/CTriggerExpression.php tr_logform.php
        sed "s,/ui',/i',g" -i api/classes/CTriggerExpression.php

        To exec that you need to be in /usr/share/zabbix

        Comment

        • shindo1687
          Junior Member
          • Sep 2012
          • 1

          #5
          Same problem

          I have same error on zabbix 2.0.2.
          This error solved by update PCRE(Perl-compatible regular expression library) package.

          Comment

          Working...