ZABBIX Forums  
  #1  
Old 21-02-2012, 05:45
sn00p sn00p is offline
Junior Member
 
Join Date: Feb 2012
Posts: 9
Default Zabbix 1.8.10, Postgres 9.1, web monitoring problem arise [SOLVED]

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 at 07:32.
Reply With Quote
  #2  
Old 21-02-2012, 05:52
sn00p sn00p is offline
Junior Member
 
Join Date: Feb 2012
Posts: 9
Default

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.
Reply With Quote
  #3  
Old 27-02-2012, 07:34
sn00p sn00p is offline
Junior Member
 
Join Date: Feb 2012
Posts: 9
Default

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.
Reply With Quote
  #4  
Old 28-02-2012, 07:02
sn00p sn00p is offline
Junior Member
 
Join Date: Feb 2012
Posts: 9
Default

https://support.zabbix.com/browse/ZBX-4705
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 01:18.