From ab1207ba861093928310e98ef107e1492239f3b6 Mon Sep 17 00:00:00 2001 From: Odysseas Lamtzidis Date: Wed, 20 Jan 2021 19:40:36 +0200 Subject: fix postgres password bug and change default config (#10531) Co-authored-by: Ilya Mashchenko --- collectors/python.d.plugin/postgres/postgres.chart.py | 2 +- collectors/python.d.plugin/postgres/postgres.conf | 9 ++++++++- 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'collectors') diff --git a/collectors/python.d.plugin/postgres/postgres.chart.py b/collectors/python.d.plugin/postgres/postgres.chart.py index ca8c3dbf15..bd28dd9b7b 100644 --- a/collectors/python.d.plugin/postgres/postgres.chart.py +++ b/collectors/python.d.plugin/postgres/postgres.chart.py @@ -1162,7 +1162,7 @@ def zero_lock_types(databases): def hide_password(config): - return dict((k, v if k != 'password' else '*****') for k, v in config.items()) + return dict((k, v if k != 'password' or not v else '*****') for k, v in config.items()) def add_database_lock_chart(order, definitions, database_name): diff --git a/collectors/python.d.plugin/postgres/postgres.conf b/collectors/python.d.plugin/postgres/postgres.conf index 3dd461408d..1970a7a274 100644 --- a/collectors/python.d.plugin/postgres/postgres.conf +++ b/collectors/python.d.plugin/postgres/postgres.conf @@ -81,7 +81,7 @@ # sslkey : path/to/key # the location of the client key file # # SSL connection parameters description: https://www.postgresql.org/docs/current/libpq-ssl.html -# +# # Additionally, the following options allow selective disabling of charts # # table_stats : false @@ -93,6 +93,10 @@ # a postgres user for netdata and add its password below to allow # netdata connect. # +# Please note that when running Postgres from inside the container, +# the client (Netdata) is not considered local, unless it runs from inside +# the same container. +# # Postgres supported versions are : # - 9.3 (without autovacuum) # - 9.4 @@ -116,6 +120,7 @@ tcp: name : 'local' database : 'postgres' user : 'postgres' + password : 'postgres' host : 'localhost' port : 5432 @@ -123,6 +128,7 @@ tcpipv4: name : 'local' database : 'postgres' user : 'postgres' + password : 'postgres' host : '127.0.0.1' port : 5432 @@ -130,5 +136,6 @@ tcpipv6: name : 'local' database : 'postgres' user : 'postgres' + password : 'postgres' host : '::1' port : 5432 -- cgit v1.2.3