Ad Widget

Collapse

Monitoring PostgreSQL with official template for zabbix agent

Collapse
This topic has been answered.
X
X
 
  • Time
  • Show
Clear All
new posts
  • H25E
    Junior Member
    • Aug 2022
    • 6

    #1

    Monitoring PostgreSQL with official template for zabbix agent

    I'm trying to monitor a postgresql instance with the official template for the zabbix agent (the one written in C).

    PSQL it's running on a debian 10 host and I installed zabbix agent with apt.

    I'm following the official instructions and I'm very confused:

    1. Install Zabbix agent and create a read-only zbx_monitor user with proper access to your PostgreSQL server.​

    No problem.

    2. Copy postgresql/ to Zabbix agent home directory /var/lib/zabbix/. The postgresql/ directory contains the files needed to obtain metrics from PostgreSQL.​

    How can you copy postgreqsl/ folder? It contains the whole DB! Do they mean a symbolic link maybe?
    Even more, for me, /var/lib/zabbix/ doesn't exist. dpkg --listfiles zabbix_agent returns:

    Code:
    /.
    /etc
    /etc/init.d
    /etc/init.d/zabbix-agent
    /etc/logrotate.d
    /etc/logrotate.d/zabbix-agent
    /etc/zabbix
    /etc/zabbix/zabbix_agentd.conf.d
    /lib
    /lib/systemd
    /lib/systemd/system
    /lib/systemd/system/zabbix-agent.service
    /usr
    /usr/bin
    /usr/bin/zabbix_sender
    /usr/lib
    /usr/lib/tmpfiles.d
    /usr/lib/tmpfiles.d/zabbix-agent.conf
    /usr/sbin
    /usr/sbin/zabbix_agentd
    /usr/share
    /usr/share/doc
    /usr/share/doc/zabbix-agent
    /usr/share/doc/zabbix-agent/README.Debian
    /usr/share/doc/zabbix-agent/changelog.Debian.gz
    /usr/share/doc/zabbix-agent/changelog.gz
    /usr/share/doc/zabbix-agent/copyright
    /usr/share/doc/zabbix-agent/examples
    /usr/share/doc/zabbix-agent/examples/userparameter_examples.conf
    /usr/share/doc/zabbix-agent/examples/userparameter_mysql.conf
    /usr/share/man
    /usr/share/man/man1
    /usr/share/man/man1/zabbix_sender.1.gz
    /usr/share/man/man8
    /usr/share/man/man8/zabbix_agentd.8.gz
    /usr/share/zabbix-agent
    /usr/share/zabbix-agent/zabbix_agentd.conf
    /var
    /var/log
    /var/log/zabbix-agent
    ​
    3. Copy template_db_postgresql.conf to Zabbix agent configuration directory /etc/zabbix/zabbix_agentd.d/ and restart Zabbix agent service.​
    What's template_db_postgresql.conf? I don't have that file on my system.

    Points 4, 5 & 6; no problem.

    I'm a little lost. Should I use agent2 for PSQL?
  • Answer selected by H25E at 20-01-2023, 10:10.
    Atsushi
    Senior Member
    • Aug 2013
    • 2028

    I think the files to be copied are files in the postgresql directory on Zabbix's Git. The template_db_postgresql.conf file is also on Zabbix'sGit.

    Comment

    • Atsushi
      Senior Member
      • Aug 2013
      • 2028

      #2
      I think the files to be copied are files in the postgresql directory on Zabbix's Git. The template_db_postgresql.conf file is also on Zabbix'sGit.

      Comment

      • cyber
        Senior Member
        Zabbix Certified SpecialistZabbix Certified Professional
        • Dec 2006
        • 4807

        #3
        Automatically created user "zabbix" in linux has /var/lib/zabbix set as home directory. It is not always present. You can put that "postresql" directory (with all the contained sql files) you download from git, where ever in your server actually. Just make sure zabbix user has access to it! Then you need to edit that template_db_postgresql.conf file, what you get with template and edit paths to scripts there to match your setup...
        If you put that postgres dir in /home/zabbix, change in conf file all the lines an replace /var/lib/zabbix to /home/zabbix.

        Comment

        • H25E
          Junior Member
          • Aug 2022
          • 6

          #4
          Yes, you are both right. I supose I was dense that day.

          Comment

          Working...