Ad Widget

Collapse

Monitoring Postgres Cluster with Zabbix using pg_monz

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jtech
    Junior Member
    • Jan 2020
    • 2

    #1

    Monitoring Postgres Cluster with Zabbix using pg_monz

    Hello

    I'm facing some issues on pg_monz under Zabbix v3.2.11 (sadly an old version to support pgCayenne). It is working good and it has even Telegram integrated.

    The issue starts when I try to use the Cluster features available on the "Template App PostgreSQL SR Cluster" and "Template App pgpool-II watchdog".


    So, I have created 2 "Host groups" according to pg_monz documentation: "PostgreSQL" and "pgpool" and added the respective hosts.
    By the way, the other templates such as " Template App pgpool-II-36", "Template App PostgreSQL" and "Template App PostgreSQL SR" works great with the triggers and graphs.

    The error messager from "Template App PostgreSQL SR Cluster" are below:
    Code:
    No items for key "psql.primary_server[/usr/local/bin,/usr/local/etc]" in group(s) "PostgreSQL".
    No items for key "psql.running[/usr/local/bin,/usr/local/etc]" in group(s) "PostgreSQL".
    No items for key "psql.standby_server[/usr/local/bin,/usr/local/etc]" in group(s) "PostgreSQL".

    I have tested the respective scripts manually on the Linux box with success, which means the authentication is fine:
    Code:
    [zabbix@standby ~]$ /usr/local/bin/pgsql_primary.sh /usr/local/etc/
    0
    
    [zabbix@standby ~]$ /usr/local/bin/pgsql_simple.sh /usr/local/etc/
    1
    
    [zabbix@standby ~]$ /usr/local/bin/pgsql_standby.sh /usr/local/etc/
    1
    Here are the details of one of the items:
    Template: "Template App PostgreSQL SR Cluster"
    Item name: Number of standby server
    Type: Zabbix aggregate
    key: grpsum[{$PG_HOST_GROUP},"psql.standby_server[{$PGSCRIPTDIR},{$PGSCRIPT_CONFDIR}]",last,0]
    Type of info: Numeric (unsigned)
    Data type: Decimal

    I have reviewed the items as suggested by Ingus in this post without success

    Also, the same problem is happening with the "Template App pgpool-II watchdog":
    Code:
    No items for key "pgpool.have_delegate_ip[/usr/local/bin,/usr/local/etc]" in group(s) "pgpool".
    No items for key "pgpool.running[/usr/local/bin,/usr/local/etc]" in group(s) "pgpool".
    There are no errors on Zabbix log (configured as debug level 3)
    CentOS Linux release 7.6 (Core)
    Postgres v11.2 Streaming Replication Cluster (Master / Slave)
    pgpool-II v3.6.18 + watchdog + heartbeat

    Thanks in advance for any help!
    Last edited by jtech; 04-01-2020, 12:22. Reason: Added Zabbix technical details
  • jtech
    Junior Member
    • Jan 2020
    • 2

    #2
    Had reviewed the process today but haven't found the cause of the issue.
    Zabbix aggregate syntax:
    Code:
    <grpmax|grpmin|grpsum|grpavg>["Host group(s)", "Item key", "<last|min|max|avg|sum|count>", "parameter"]
    Template item syntax:
    Code:
    grpsum[{$PG_HOST_GROUP},"psql.standby_server[{$PGSCRIPTDIR},{$PGSCRIPT_CONFDIR}]",last,0]
    Bash script with SQL code located on postgres server (tested with success)
    Code:
    ./usr/local/bin/pgsql_standby.sh /usr/local/etc
    Zabbix error message:
    Code:
    No items for key "psql.standby_server[/usr/local/bin,/usr/local/etc]" in group(s) "PostgreSQL".

    It might the bug ZBX-11658 due to my Zabbix v3.2.11.
    Last edited by jtech; 09-01-2020, 14:15. Reason: added process revision

    Comment

    Working...