Unable to get data by using postgresql module of metricbeat 7.6.2

I have installed postgresql in RHEL, and created one sample database for postgres owner.

With the following configuration of postgresql.yml:
Preformatted text# Module: postgresql

Docs: https://www.elastic.co/guide/en/beats/metricbeat/7.6/metricbeat-module-postgresql.html

  • module: postgresql
    enabled: true
    metricsets:
    • database
    • bgwriter
    • activity
      period: 10s
      hosts: ["postgres://localhost:5432?sslmode=disable"]
      username: postgres
      #password: passPreformatted text

for above yml testing output using:
metricbeat test modules postgresql

output:
database...
error... ERROR error in QueryStats: failed to obtain a connection with the database: pq: Ident authentication failed for user "postgres"
bgwriter...
error... ERROR error in QueryStats: failed to obtain a connection with the database: pq: Ident authentication failed for user "postgres"
activity...
error... ERROR error in QueryStats: failed to obtain a connection with the database: pq: Ident authentication failed for user "postgres"

Please someone help me out regarding this issue.
Thanks

hi @akELK081, looking at the configuration the password option is disabled. Is this enabled in your tests? Also, can you verify if you can authenticate in postgresql with the username and password provided in the configuration ?

Hi @MarianaD, I already tried to authenticate with postgres username and password , but I am facing same issue.
Can you help out regarding username and password, like which user credentials should I use? rhel server or postgres DB owners.

Actually I followed this:
https://www.elastic.co/guide/en/beats/metricbeat/current/metricbeat-module-postgresql.html

And its example configuration creates confusion for users to me,

As per the above screenshot I tried few string parameter based postgres url. i.e,

Hi @MarianaD, I find a solution for above problem, by allowing local connection to postgresql ( The file pg_hba.conf governs the basic constraints underlying connection to PostgreSQL, where I modified local socket connections from "peer" to "md5" and modified local loopback connections over IPv6 from "ident" to "md5"). Now I am able to see metrcibeat pg_overview dashboard in kibana.

Can you let me know which auth-methods (trust, ident, md5, reject, peer etc) of postgres are compatible with the postgresql module available in beats.

Thanks :grinning:

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.