[ZBX-16640] PostgreSQL: Streaming lag with {#MASTER} is too high (over 10m in 5m) Created: 2019 Sep 14  Updated: 2020 Jun 15  Resolved: 2020 Jun 15

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Templates (T)
Affects Version/s: 4.2.6
Fix Version/s: None

Type: Incident report Priority: Trivial
Reporter: Germán Rivas Assignee: Renats Valiahmetovs (Inactive)
Resolution: Fixed Votes: 0
Labels: database, expressions, postgres, templates, triggers
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

GNU/Linux Debian 9 x64 + PostgreSQL 11 + Zabbix 4.2.6


Attachments: PNG File Replication lag in seconds - Graph.PNG     PNG File Replication lag in seconds - Latest data.PNG    

 Description   

Hello everyone, I'm monitoring a PostgreSQL11 database on Zabbix 4.2.6 with the following template (https://git.zabbix.com/projects/ZBX/repos/zabbix/browse/templates/db/postgresql), and everything works correctly, but in my control panel appears the following trigger:

 

"PostgreSQL: Streaming lag with {#MASTER} is too high (over 10m in 5m)"

 

This is the internal configuration of the template

  • Name PostgreSQL: Streaming lag with {#MASTER} is too high (over {$PG.REPL_LAG.MAX.WARN} in 5m)
  • Expression {Zabbix server:pgsql.replication.lag.sec["\{$PG.HOST}","\{$PG.PORT}","\{$PG.USER}","\{$PG.DB}"].min(5m)} > {$PG.REPL_LAG.MAX.WARN} {$PG.REPL_LAG.MAX.WARN}

And this is the configuration of the item where this trigger is activated

Name Replication: lag in seconds
Type Zabbix Agent
Key pgsql.replication.lag.sec["\{$PG.HOST}","\{$PG.PORT}","\{$PG.USER}","\{$PG.DB}"]
Host interface 127.0.0.1 10050
Type of information Numeric (float)
Units s

It's my only Zabbix server and we don't have replication activated with another server. What do you recommend me to do? Should I deactivate this trigger or should I correct something in the template or script that serves to monitor PostgreSQL?

Thank you.



 Comments   
Comment by Vitaly Zhuravlev [ 2019 Sep 15 ]

Which value  of "Zabbix server:pgsql.replication.lag.sec " of itemdo you receive?

Comment by Germán Rivas [ 2019 Sep 16 ]

The values I get are at the timescale level. Look at the following attached images.

From the command prompt by executing the following command:

cat /var/log/zabbix/zabbix_server.log | grep replication

I don't figure any mistakes or anything that looks wrong.

Comment by Omni Flux [ 2020 Mar 04 ]

Should this trigger actually be

{Template DB PostgreSQL:pgsql.replication.status["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.DB}"].max(5m)} = 1 and
{Template DB PostgreSQL:pgsql.replication.lag.sec["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.DB}"].min(5m)} > {$PG.REPL_LAG.MAX.WARN}
Comment by Johannes Münch [ 2020 May 13 ]

@Omniflux Your solution works for me and it makes sense.
Is there a plan to officially update the template?

Comment by Renats Valiahmetovs (Inactive) [ 2020 Jun 15 ]

This issue has not been updated for more than 14 days. We are automatically closing this issue, but if the problem is not yet resolved and requires additional work, you may reopen it within the next 30 days by commenting on the ticket.

But I'd like to point out that the trigger in question has been updated and is as below:

{Template DB PostgreSQL:pgsql.replication.lag.sec["{$PG.HOST}","{$PG.PORT}","{$PG.USER}","{$PG.DB}"].min(5m)} > {$PG.REPL_LAG.MAX.WARN}

 Best Regards,

Generated at Mon Sep 01 22:20:25 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.