summaryrefslogtreecommitdiffstats
path: root/collectors
diff options
context:
space:
mode:
authorOdysseas Lamtzidis <odyslam@gmail.com>2021-01-20 19:40:36 +0200
committerGitHub <noreply@github.com>2021-01-20 20:40:36 +0300
commitab1207ba861093928310e98ef107e1492239f3b6 (patch)
tree11b7a658f0bda488b1c5a816d7c4cbe4eb40e590 /collectors
parentfd185b623858507bef11017b451afde4baf08872 (diff)
fix postgres password bug and change default config (#10531)
Co-authored-by: Ilya Mashchenko <ilya@netdata.cloud>
Diffstat (limited to 'collectors')
-rw-r--r--collectors/python.d.plugin/postgres/postgres.chart.py2
-rw-r--r--collectors/python.d.plugin/postgres/postgres.conf9
2 files changed, 9 insertions, 2 deletions
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