Ad Widget

Collapse

Agent service doesn't restart after install postgresql agent

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mmfernandez
    Junior Member
    • Mar 2025
    • 4

    #1

    Agent service doesn't restart after install postgresql agent

    Hi everyone.

    I have installed postgresql agent following the instruction from here and here and I'm getting error when I'm trying to restart agent service.

    S.O. : OEL 9.5
    Postgresql : 17.4
    zabbix : 7.2.4

    [root@pgsql01 ~]# zabbix_server -V
    zabbix_server: /usr/pgsql-17/lib/libpq.so.5: no version information available (required by zabbix_server)
    zabbix_server (Zabbix) 7.2.4
    Revision c34078a4563 25 February 2025, compilation time: Feb 25 2025 00:00:00

    Copyright (C) 2025 Zabbix SIA
    License AGPLv3: GNU Affero General Public License version 3 <https://www.gnu.org/licenses/>.
    This is free software: you are free to change and redistribute it according to
    the license. There is NO WARRANTY, to the extent permitted by law.

    This product includes software developed by the OpenSSL Project
    for use in the OpenSSL Toolkit (http://www.openssl.org/).

    Compiled with OpenSSL 3.0.7 1 Nov 2022
    Running with OpenSSL 3.2.2 4 Jun 2024


    The agent instalation have this elements:

    [root@pgsql01 ~]# ls -l /var/lib
    ..
    ..
    drwxr-xr-x. 2 root root 4096 Nov 29 10:21 tuned
    drwxr-xr-x. 2 root root 4096 May 3 2022 up2date
    drwxr-xr-x. 2 root root 4096 Feb 25 07:19 VBoxGuestAdditions
    drwxr-xr-x. 3 root root 4096 Feb 24 10:48 xfsdump
    drwxrwx---. 3 zabbix zabbix 4096 Mar 13 08:57 zabbix


    [root@pgsql01 ~]# ls -al /var/lib/zabbix
    total 16
    drwxrwx---. 3 zabbix zabbix 4096 Mar 13 09:13 .
    drwxr-xr-x. 46 root root 4096 Mar 13 08:10 ..
    -rw-------. 1 root root 94 Mar 13 08:36 .pgpass
    drwxr-x---. 2 root root 4096 Mar 13 08:14 postgresql

    ​​​​
    [root@pgsql01 ~]# ls -l /etc/zabbix/
    total 64
    drwxr-xr-x. 2 apache apache 4096 Mar 10 11:04 web
    -rw-r--r--. 1 root root 17274 Feb 25 05:27 zabbix_agentd.conf
    drwxr-xr-x. 2 root root 4096 Mar 13 08:18 zabbix_agentd.d
    -rw-------. 1 root zabbix 29708 Mar 10 12:34 zabbix_server.conf
    drwxr-xr-x. 2 root root 4096 Feb 25 05:28 zabbix_server.d


    [root@pgsql01 ~]# ls -al /etc/zabbix
    total 80
    drwxr-xr-x. 5 root root 4096 Mar 12 16:03 .
    drwxr-xr-x. 131 root root 12288 Mar 12 11:28 ..
    drwxr-xr-x. 2 apache apache 4096 Mar 10 11:04 web
    -rw-r--r--. 1 root root 17274 Feb 25 05:27 zabbix_agentd.conf
    drwxr-xr-x. 2 root root 4096 Mar 13 08:18 zabbix_agentd.d
    -rw-------. 1 root zabbix 29708 Mar 10 12:34 zabbix_server.conf
    drwxr-xr-x. 2 root root 4096 Feb 25 05:28 zabbix_server.d
    [root@pgsql01 ~]# ls -al /etc/zabbix/zabbix_agentd.d
    total 12
    drwxr-xr-x. 2 root root 4096 Mar 13 08:18 .
    drwxr-xr-x. 5 root root 4096 Mar 12 16:03 ..
    -rwxr-x---. 1 root root 2800 Mar 13 08:18 template_db_postgresql.conf

    When I'm trying to start the agent server I have :


    [root@pgsql01 ~]# systemctl start zabbix-agent.service
    Job for zabbix-agent.service failed because the control process exited with error code.
    See "systemctl status zabbix-agent.service" and "journalctl -xeu zabbix-agent.service" for details.

    [root@pgsql01 ~]# systemctl status zabbix-agent.service
    ● zabbix-agent.service - Zabbix Agent
    Loaded: loaded (/usr/lib/systemd/system/zabbix-agent.service; enabled; preset: disabled)
    Active: activating (auto-restart) (Result: exit-code) since Thu 2025-03-13 09:21:08 -03; 7s ago
    Process: 66218 ExecStart=/usr/sbin/zabbix_agentd -c $CONFFILE (code=exited, status=1/FAILURE)
    CPU: 5ms

    Mar 13 09:21:08 pgsql01.advora.cl systemd[1]: zabbix-agent.service: Control process exited, code=exited, status=1/FAILURE
    Mar 13 09:21:08 pgsql01.advora.cl systemd[1]: zabbix-agent.service: Failed with result 'exit-code'.
    Mar 13 09:21:08 pgsql01.advora.cl systemd[1]: Failed to start Zabbix Agent.

    [root@pgsql01 ~]# journalctl -xeu zabbix-agent.service
    Mar 13 09:21:19 pgsql01.advora.cl zabbix_agentd[66232]: zabbix_agentd [66232]: cannot open config file "/etc/zabbix/zabbix_agentd.d>
    Mar 13 09:21:19 pgsql01.advora.cl systemd[1]: zabbix-agent.service: Control process exited, code=exited, status=1/FAILURE
    ░░ Subject: Unit process exited
    ░░ Defined-By: systemd
    ░░ Support: https://support.oracle.com
    ░░
    ░░ An ExecStart= process belonging to unit zabbix-agent.service has exited.
    ░░
    ░░ The process' exit code is 'exited' and its exit status is 1.
    Mar 13 09:21:19 pgsql01.advora.cl systemd[1]: zabbix-agent.service: Failed with result 'exit-code'.
    ░░ Subject: Unit failed
    ░░ Defined-By: systemd
    ░░ Support: https://support.oracle.com
    ░░
    ░░ The unit zabbix-agent.service has entered the 'failed' state with result 'exit-code'.
    Mar 13 09:21:19 pgsql01.advora.cl systemd[1]: Failed to start Zabbix Agent.
    ░░ Subject: A start job for unit zabbix-agent.service has failed
    ░░ Defined-By: systemd
    ░░ Support: https://support.oracle.com
    ░░
    ░░ A start job for unit zabbix-agent.service has finished with a failure.
    ░░
    ░░ The job identifier is 42835 and the job result is failed.
    [root@pgsql01 ~]#​

    The service proccess is trying to read de configuration file "/etc/zabbix/zabbix_agentd.d
    ​" and this is a directory.

    I would appreciate any sugestion

    Thanks in advance

    Kind Regards

    Mauricio Fernández

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

    #2
    -rwxr-x---. 1 root root 2800 Mar 13 08:18 template_db_postgresql.conf
    I suppose it should be readable for zabbix, but is owned by root and no "other" can read it ....
    And I am pretty sure your zabbix agent can not read your pgpass aswell..
    -rw-------. 1 root root 94 Mar 13 08:36 .pgpass

    Comment

    • mmfernandez
      Junior Member
      • Mar 2025
      • 4

      #3
      Hi, thank you for the answer. You were rigth, it was a permisision problem.

      issue resolved

      kind regards

      Mauricio Fernández

      Comment

      • mmfernandez
        Junior Member
        • Mar 2025
        • 4

        #4
        Hi, I could start de agent service with the postgresql agent but, I think; is not working

        The main page show the following. The hos added is "Postgresql Primary"

        Click image for larger version

Name:	image.png
Views:	122
Size:	21.7 KB
ID:	500671
        There is only one item enabled

        Click image for larger version

Name:	image.png
Views:	108
Size:	14.7 KB
ID:	500672
        The rest is with status "not supoorted" and with info

        Click image for larger version

Name:	image.png
Views:	104
Size:	11.1 KB
ID:	500673

        I don't see any error page with indications of what is going on...

        Please I would appretiate any tips or page with instruction about how to proceed.

        Thanks in advance

        Kind regards

        Mauricio Fernández​

        Comment

        • mmfernandez
          Junior Member
          • Mar 2025
          • 4

          #5
          I need to add the trigger "ping" is getting status "0" while the postgresql instance is running correctly

          Click image for larger version

Name:	image.png
Views:	118
Size:	12.2 KB
ID:	500696

          I guess may be this is the source of I'm getting most of the items with "not supoorted" status.

          Comment

          Working...