Hello Everyone.
Zabbix v6.2.7
PSQL v14.5
I started to use Zabbix recently and I got how to collect some basic metrics and some not (i.e. self-made calculated).
However, currently I stuck with one specific thing.
What I'd like to create:
I'd like to collect some PGSQL metrics (there are some service tables that allow this, so I just need custom query for each metric, e.g. pg_stat_all_tables) and show them on per-table basis with table name labels.
E.g. display changes of size for top N largest tables. Let's consider N=1 for simplicity in the examples below.
What I currently have:
I created custom SQL query, that returns just two required columns 'name' and 'size', made it all-set and successfully receive JSON at Zabbix server using this expression:
Code:
pgsql.custom.query["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}","{$PG.DATABASE}","size"]
Code:
[{"name":"tablename", size:123}]
The question is:
Is it possible at all? If yes, how could this be achieved? If no, possible I'm moving the wrong way and there is some more common flow giving the desired result.
Comment