[ZBX-20852] Zabbix agent 2 pgsql.custom.query Cannot fetch data: expected 1 arguments, got 6. Created: 2022 Apr 05  Updated: 2025 Feb 28  Resolved: 2025 Feb 28

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: None
Affects Version/s: 5.0.22
Fix Version/s: None

Type: Problem report Priority: Trivial
Reporter: Tauri Jaanus Assignee: Stanislavs Jurgensons (Inactive)
Resolution: Won't fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

CentOS 7


Attachments: PNG File image-2022-04-05-16-14-35-647.png     PNG File image-2022-04-05-16-18-47-157.png    
Story Points: 0.2

 Description   

Steps to reproduce:

After upgrading Zabbix Agent 2 to 5.0.22 (5.0.22-1.el7)

item.key: pgsql.custom.query["\{$PG.SESSIONNAME}",,,,"postgresql_db_size",,,,,,"postgres"]

preprocess:

script:
postgresql_db_size.sql
##content
SELECT pg_database_size(datname::text) FROM pg_catalog.pg_database WHERE datistemplate = false AND datname = $1;

##

Item is active agent item.

NB! if item is passive agent item, then there is no problems.

Result:
2022/04/05 15:51:36.001584 [Postgres] Cannot fetch data: expected 1 arguments, got 6.
2022/04/05 15:51:36.001624 check 'pgsql.custom.query["POSTGRESQL",,,,"postgresql_db_size",,,,,,"postgres"]' is not supported: Cannot fetch data: expected 1 arguments, got 6.
2022/04/05 15:51:37.001176 [Postgres] Cannot fetch data: expected 1 arguments, got 6.

Expected:
Get value in as expected.



 Comments   
Comment by Tauri Jaanus [ 2022 Apr 05 ]

We downgraded to 5.0.21 and it still working there. 

I think it is possible connected with this: https://support.zabbix.com/browse/ZBX-20528

Comment by Tauri Jaanus [ 2023 Jan 17 ]

Solution:
change: pgsql.custom.query["POSTGRESQL",,,,"postgresql_db_size",,,,,,"postgres"]

to: pgsql.custom.query["POSTGRESQL",,,,"postgresql_db_size","postgres"]

Generated at Wed May 07 05:35:54 EEST 2025 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.