[ZBX-4705] Zabbix 1.8.10+Postgresql 9.1 default settings - web scenarious with macros inside possibly broken Created: 2012 Feb 28  Updated: 2017 May 30  Resolved: 2015 Feb 19

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Server (S)
Affects Version/s: 1.8.10
Fix Version/s: None

Type: Incident report Priority: Trivial
Reporter: Artem Silenkov Assignee: Unassigned
Resolution: Cannot Reproduce Votes: 0
Labels: macros, postgresql, upgrade
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Ubuntu 10.04, Zabbix 1.8.10, PostgreSQL 9.1 with default settings


Attachments: PNG File test.png    

 Description   

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[/CODE]

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[/CODE]

But not in postgres with default settings:
[CODE]{firmID}=1\015\012{filialID}

=1\015\012

{city}

=Barnaul\015\012{version}=1\015\012

{key}=1[/CODE]

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
[/CODE]

We made dirty hack to restore functionality.
zabbix/src/zabbix_server/httppoller/httpmacro.c (84)

Was:
[CODE]replacement++;
if(NULL != (c2 = strchr(replacement,'[B]\r[/B]')))
{
[/CODE]

Now:
[CODE]replacement++;
if(NULL != (c2 = strchr(replacement,'[B]:[/B]')))
{ [/CODE]

And made ":" separator between {key}

as:

{key}

=value:

{key1}

=value:

{key2}

=value
It works now.

It seems that with default DB settings the way httpmacro.c do this work is incorrect. We have no '\r' in postgres. Or we do something wrong )



 Comments   
Comment by Artem Silenkov [ 2012 Feb 28 ]

screenshot from 1.9.10 but 1.8.10 do the same.
CRLF is substituted with \015\012 after save and reopen.

Comment by Oleksii Zagorskyi [ 2012 Feb 28 ]

forum thread http://www.zabbix.com/forum/showthread.php?t=25149
an issue ZBX-3940 could be related.

Comment by Artem Silenkov [ 2012 Feb 28 ]

Also
http://www.zabbix.com/forum/showthread.php?t=25161
in english

Comment by Alexander Vladishev [ 2013 Feb 05 ]

Cannot reproduce on 1.8.10, latest 1.8, 2.0 and trunk r32423.

Probably, a problem in different versions of the PostgreSQL client (library) and the server.

The issue still reproducible on your environment?

Thanks.

Comment by Alexander Vladishev [ 2015 Feb 19 ]

Version 1.8 is no longer supported. Feel free to reopen if it is reproducible on latest versions of Zabbix.

Generated at Thu Apr 25 20:23:58 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.