diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2019-04-17 17:57:35 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2019-04-17 17:57:35 +0000 |
commit | 3b95e5be69c199a2a195c57aba12d88c242225ac (patch) | |
tree | 137b72ffaefe7f34bf21e975ccc9cc9ec0474564 /collectors/python.d.plugin/mongodb/mongodb.chart.py | |
parent | Adding upstream version 1.13.0. (diff) | |
download | netdata-upstream/1.14.0_rc0.tar.xz netdata-upstream/1.14.0_rc0.zip |
Adding upstream version 1.14.0~rc0.upstream/1.14.0_rc0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | collectors/python.d.plugin/mongodb/mongodb.chart.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/collectors/python.d.plugin/mongodb/mongodb.chart.py b/collectors/python.d.plugin/mongodb/mongodb.chart.py index 92740ff86..ee32593c2 100644 --- a/collectors/python.d.plugin/mongodb/mongodb.chart.py +++ b/collectors/python.d.plugin/mongodb/mongodb.chart.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- # Description: mongodb netdata python.d module -# Author: l2isbad +# Author: ilyam8 # SPDX-License-Identifier: GPL-3.0-or-later from copy import deepcopy @@ -424,6 +424,7 @@ class Service(SimpleService): SimpleService.__init__(self, configuration=configuration, name=name) self.order = ORDER[:] self.definitions = deepcopy(CHARTS) + self.authdb = self.configuration.get('authdb', 'admin') self.user = self.configuration.get('user') self.password = self.configuration.get('pass') self.host = self.configuration.get('host', '127.0.0.1') @@ -707,7 +708,7 @@ class Service(SimpleService): try: connection = MongoClient(**conn_vars) if self.user and self.password: - connection.admin.authenticate(name=self.user, password=self.password) + getattr(connection, self.authdb).authenticate(name=self.user, password=self.password) # elif self.user: # connection.admin.authenticate(name=self.user, mechanism='MONGODB-X509') server_status = connection.admin.command('serverStatus') |