Ad Widget

Collapse

psql: error: /var/lib/zabbix/postgresql/pgsql.connections.sum.sql: Permission denied

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • theerth17
    Junior Member
    • Jul 2021
    • 2

    #1

    psql: error: /var/lib/zabbix/postgresql/pgsql.connections.sum.sql: Permission denied

    Hi,

    I am running Zabbix 5.0 on a RHEL 7.8 VM that is running Postgres. I am able to receive the metrics of the server but not the database. I get this error when I lookup the latest data:

    psql: error: /var/lib/zabbix/postgresql/pgsql.connections.sum.sql: Permission denied

    Thanks
    Last edited by theerth17; 07-07-2021, 13:27.
  • KPiatek
    Junior Member
    • Jan 2022
    • 5

    #2
    Greetings,

    Have you been able to solve this problem? I am currently struggling with an identical one. The interesting thing is that directly on the VM I am able to get this data by manually dropping in a command.

    Comment

    • theerth17
      Junior Member
      • Jul 2021
      • 2

      #3
      Yes this was because of the permissions of parent folders. I moved the Postgres files to another directory and updated the path, it worked.

      Comment

      • JulioQc
        Junior Member
        • Dec 2018
        • 28

        #4
        Same problem on similar setup. More details on permissions required so I can adjust /var/lib/zabbix instead of moving folders around?

        EDIT: Ok if someone needs to know I found in /var/log/message its SE linux blocking access for psql binaries (in /usr/pgsql-13/bin/psql for me) to .sql files in /var/lib/zabbix. Easy way out is setting SElinux permissive. You can also move .sql files to a folder psql can access without triggering SE and adjusting the template_db_postgresql.conf file to that directory. You can also write SE policy to bypass the problem, which I will attempt in order to fix this clean.
        Last edited by JulioQc; 03-02-2022, 16:21.

        Comment

        • WendoNZ
          Junior Member
          • Apr 2022
          • 3

          #5
          JulioQc, did you ever write a policy for this?

          I've been banging my head against this for too many hours now and have hit this (hopefully) final roadblock. I don't know enough about selinux to have any hope of writing a policy myself and looking at the docs the easiest way appears to be using a GUI (which I don't have on any of the boxes I have available).

          I'd rather not switch to permissive on these boxes. I may just move the SQL files and update the template but don't even know where is safe to move them (into /etc/zabbix with the template?)

          Comment

          Working...