summaryrefslogtreecommitdiffstats
path: root/collectors
diff options
context:
space:
mode:
authorPaul Mezzanini <paul@themezz.com>2020-03-04 10:09:01 -0500
committerGitHub <noreply@github.com>2020-03-04 10:09:01 -0500
commit4ca5569f9e3bc3496215eb34e27e005e717b56b1 (patch)
tree30451287f1d3df3c2c0653a8676da77ab94f372f /collectors
parent8fa08655ebb80846eb69f0467e7b3fb9f3e8ec72 (diff)
Added ability to change ID used to connect to ceph. (#8276)
* Added ability to change ID used to connect to ceph. Allows the creation of a user with read only caps for the mon + mgr. * Force "admin" as rados_id if none given.
Diffstat (limited to 'collectors')
-rw-r--r--collectors/python.d.plugin/ceph/ceph.chart.py4
-rw-r--r--collectors/python.d.plugin/ceph/ceph.conf4
2 files changed, 6 insertions, 2 deletions
diff --git a/collectors/python.d.plugin/ceph/ceph.chart.py b/collectors/python.d.plugin/ceph/ceph.chart.py
index a85576eebf..207f521072 100644
--- a/collectors/python.d.plugin/ceph/ceph.chart.py
+++ b/collectors/python.d.plugin/ceph/ceph.chart.py
@@ -120,6 +120,7 @@ class Service(SimpleService):
self.definitions = CHARTS
self.config_file = self.configuration.get('config_file')
self.keyring_file = self.configuration.get('keyring_file')
+ self.rados_id = self.configuration.get('rados_id', 'admin')
def check(self):
"""
@@ -148,7 +149,8 @@ class Service(SimpleService):
return False
try:
self.cluster = rados.Rados(conffile=self.config_file,
- conf=dict(keyring=self.keyring_file))
+ conf=dict(keyring=self.keyring_file),
+ rados_id=self.rados_id)
self.cluster.connect()
except rados.Error as error:
self.error(error)
diff --git a/collectors/python.d.plugin/ceph/ceph.conf b/collectors/python.d.plugin/ceph/ceph.conf
index 4caabbf6d4..81788e866e 100644
--- a/collectors/python.d.plugin/ceph/ceph.conf
+++ b/collectors/python.d.plugin/ceph/ceph.conf
@@ -64,10 +64,12 @@
# config_file: 'config_file' # Ceph config file.
# keyring_file: 'keyring_file' # Ceph keyring file. netdata user must be added into ceph group
# # and keyring file must be read group permission.
+# rados_id: 'rados username' # ID used to connect to ceph cluster. Allows
+# # creating a read only key for pulling data v.s. admin
# ----------------------------------------------------------------------
# AUTO-DETECTION JOBS
# only one of them will run (they have the same name)
#
config_file: '/etc/ceph/ceph.conf'
keyring_file: '/etc/ceph/ceph.client.admin.keyring'
-
+rados_id: 'admin'