Ad Widget

Collapse

Postgresql monitoring with Agent 2 and Session names

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pexy
    Junior Member
    • Sep 2021
    • 2

    #1

    Postgresql monitoring with Agent 2 and Session names

    I have questions regarding setting up Postgresql monitoring with Agent 2 Postgresql plugin and session names

    I'm using Zabbix 5.4 and Postgresql 13.4. I know that PG13 is not yet supported, but in reality pgsql.wal.stat is the only item that has issues because of the version.

    In plugin readme (https://git.zabbix.com/projects/ZBX/...gres/README.md) there is an example conf to connecting to two separate postgresql instances. Before that example it tells that supported parameters are Uri, User, Password, Service, TLSConnect, TLSCAFile, TLSCertFile and TLSKeyFile, but in example there are following rows:

    Plugins.Postgres.Sessions.Prod.Database=proddb
    Plugins.Postgres.Sessions.Test.Service=testdb

    What is the difference between Database and Service?
    Does these two parameters (.Database and .Service) only specify the database to connect to when connecting a Postgresql instance (with specific IP and port) and monitoring of all databases in this instance is possible or do these parameters allow monitoring only that specific database to which the connection was made (kinda breaks the LLD purpose)?

    In the same README.md it specifies, that when using session names, just skip the rest of the connection parameters.
    I am using a template from Zabbix (https://www.zabbix.com/integrations/...tgresql_agent2,
    How should I configure database specific (not PostgreSQL engine, but actual database containing schemas and tables) items, which are created by LLD (e.g. pgsql.db.age, pgsql.db.size, pgsql.db.bloating_tables)?

    For example with URI the item is
    Code:
    pgsql.db.age["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}","{#D BNAM E}"]
    but with sessionname it does not work
    Code:
    pgsql.db.age["{$PG.SESSIONNAME}","{#DBNAME}"]
    Fails with error "Invalid parameters: second parameter "User" cannot be passed along with session."

    Shifting the {#DBNAME} does not help
    Code:
    pgsql.db.age["{$PG.SESSIONNAME}",,"{#DBNAME}"]
    Invalid parameters: third parameter "Password" cannot be passed along with session.

    Up until
    Code:
    pgsql.db.age["{$PG.SESSIONNAME}",,,,,,,,"{#DBNAME}"]
    Too many parameters.

    Just to assure that this issue is not about Postgresql 13 i ran the SQL from https://git.zabbix.com/projects/ZBX/...atabase_age.go directly from psql without problems.
  • splitek
    Senior Member
    • Dec 2018
    • 101

    #2
    Originally posted by pexy
    I have questions regarding setting up Postgresql monitoring with Agent 2 Postgresql plugin and session names
    Plugins.Postgres.Sessions.Prod.Database=proddb
    Plugins.Postgres.Sessions.Test.Service=testdb

    What is the difference between Database and Service?
    Does these two parameters (.Database and .Service) only specify the database to connect to when connecting a Postgresql instance (with specific IP and port) and monitoring of all databases in this instance is possible or do these parameters allow monitoring only that specific database to which the connection was made (kinda breaks the LLD purpose)?
    It is a mistake. Here are keys for agent2:



    "Service" is only in Oracle.

    Also look here: https://www.zabbix.com/integrations/...tgresql_agent2
    PostgreSQL DB {#DBNAME}: Database age Database age ZABBIX_PASSIVE pgsql.db.age["{$PG.URI}","{$PG.USER}","{$PG.PASSWORD}","{#DBNAM E}"]

    Comment

    Working...