Announcement

Collapse
No announcement yet.

Zabbix 1.8.10, Postgres 9.1, web monitoring problem arise

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

    Zabbix 1.8.10, Postgres 9.1, web monitoring problem arise

    Hello!
    Recently we've changed our database backend from mysql to postgres with data porting and have no problem except one.
    We use different macros in web monitoring like
    Code:
    {firmID}=1
    {filialID}=1
    {city}=Barnaul
    {version}=1
    {key}=1
    In mysql it is stored like
    Code:
    {firmID}=1\r\n{filialID}=1\r\n{city}=Barnaul\r\n{version}=1\r\n{key}=1
    But not in postgres:
    Code:
    {firmID}=1\015\012{filialID}=1\015\012{city}=Barnaul\015\012\{version}=1\015\012{key}=1
    It seems that postgres stores CRLF like \015\012 and all the web monitoring is broken right now with "Page did not match". We've tried different settings in database config with no success.
    Code:
    backslash_quote = safe_encoding
    standard_conforming_strings = on
    Any suggestions how to fix macros parsing here? Any help would be appreciated. Problem persists in zabbix v1.9.9. It all works good without macros but this is not the case.
    Last edited by sn00p; 27-02-2012, 08:32.

    #2
    I've read postgres documentation about backslashes here

    In webui in httptest.inc.php (241)
    - added E like
    Code:
    macros=E'.zbx_dbstr($macros).', '.
    In some postgresql settings combination it stores "\r\n" the way mysql do but with no success. Web monitoring is still broken.

    Comment


      #3
      We made dirty hack to restore functionality.

      zabbix/src/zabbix_server/httppoller/httpmacro.c (84)

      Was:
      Code:
      replacement++;                                                                                                                                                     
      if(NULL != (c2 = strchr(replacement,'\r')))                                                                                                                         
      {
      Now:
      Code:
      replacement++;                                                                                                                                                     
      if(NULL != (c2 = strchr(replacement,':')))                                                                                                                         
      {
      And made ":" separator between {key} as:
      {key}=value:{key1}=value:{key2}=value

      It works now, thanks all of you.

      PS: It is strange that we alone encountered this problems. It seems that nobody use web monitoring with macros in postgresql installation.

      Comment


        #4
        https://support.zabbix.com/browse/ZBX-4705

        Comment

        Working...
        X