Ad Widget

Collapse

postgres thinks zabbix is running as root

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mkash28
    Junior Member
    • Oct 2015
    • 13

    #1

    postgres thinks zabbix is running as root

    zabbix is setup to run as user 'zabbix' (as default) but when trying to add posters monitoring module 'libzbxpgsql' to zabbix on a pgsql database server getting these errors.
    please note a role for zabbix has been created in database and has been mapped to zabbix. it hasn't been able to work so far, need help!!

    abbix_agentd [12691]: Error: Failed to connect to PostgreSQL in pg_connect():
    FATAL: role "root" does not exist

    zabbix_agentd [12691]: Error: Failed to connect to PostgreSQL in pg_connect():
    FATAL: role "root" does not exist

    zabbix_agentd [12691]: Error: Failed to connect to PostgreSQL in pg_connect():
    FATAL: role "root" does not exist

    zabbix_agentd [12691]: Error: Failed to connect to PostgreSQL in pg_connect():
    FATAL: role "root" does not exist

    zabbix_agentd [12691]: Error: Failed to connect to PostgreSQL in pg_connect():
    FATAL: role "root" does not exist
  • cavaliercoder
    Junior Member
    • Apr 2014
    • 13

    #2
    Firstly, my apologies as I didn't see a notification for your message.

    You say you've mapped the Postgresql `zabbix` role to the system account `zabbix` but it appears your agent is running as `root`. Please try mapping the `zabbix` Postgresql role to the system user `root` instead and advise.

    Also, make sure you specify `user=zabbix` in your connection string.

    Please see:

    Comment

    • mkash28
      Junior Member
      • Oct 2015
      • 13

      #3
      thanks for the response!

      here is what I have so far

      {$PG_CONN} host=127.0.0.1 port=5432 user=zabbix

      pg_hba.conf
      #for Zabbix
      local all zabbix trust
      local all root trust


      pg_ident.conf
      zabbix root zabbix

      restarting with zabbix-agent didnt work but i have to now schedule a 'pgsql restart' to test the change.

      Comment

      • cavaliercoder
        Junior Member
        • Apr 2014
        • 13

        #4
        The `local` bit in your pg_hba.conf means it applies only to Unix sockets (basically file handles), not TCP/IP connections which you are using in your connection string.

        Please try omitting the host and port from your connection string. This way, the Zabbix agent will connect via the default socket and you *should* be in business.

        You can delete the second line of your pg_hba.conf (the line with root) as root is not a recognised PostgreSQL role. This file only knows about roles; not system users.

        pg_ident.conf "maps" system users to PostgreSQL roles.

        Another note; I would recommend using peer auth instead of trust.

        Comment

        • mkash28
          Junior Member
          • Oct 2015
          • 13

          #5
          thanks for your response!

          thanks for your response! I just checked it today. was out of office. It is very good information. I made the changes accordingly. Just need to schedule a database restart so the impact can be tested. keeping my hopes up! thanks!

          Comment

          Working...