From e66e72c98a4f4f68f3c00e7c5f715df7c9678d4f Mon Sep 17 00:00:00 2001 From: cfz Date: Wed, 1 Jun 2016 03:34:53 +0800 Subject: [PATCH 1/3] fix typo --- plugins/ceph_pool_plugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/ceph_pool_plugin.py b/plugins/ceph_pool_plugin.py index ab2378b..257be90 100755 --- a/plugins/ceph_pool_plugin.py +++ b/plugins/ceph_pool_plugin.py @@ -54,7 +54,7 @@ def get_stats(self): osd_pool_cmdline='ceph osd pool stats -f json --cluster ' + self.cluster stats_output = subprocess.check_output(osd_pool_cmdline, shell=True) cephdf_cmdline='ceph df -f json --cluster ' + self.cluster - df_output = subprocess.check_output(ceph_dfcmdline, shell=True) + df_output = subprocess.check_output(cephdf_cmdline, shell=True) except Exception as exc: collectd.error("ceph-pool: failed to ceph pool stats :: %s :: %s" % (exc, traceback.format_exc())) From eb9de794bbe0829f2d5271d618eaf073a5d43e83 Mon Sep 17 00:00:00 2001 From: cfz Date: Thu, 16 Jun 2016 01:43:43 +0800 Subject: [PATCH 2/3] add new client_io_rate metics for Jewel --- plugins/ceph_pool_plugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/ceph_pool_plugin.py b/plugins/ceph_pool_plugin.py index 257be90..b1f2787 100755 --- a/plugins/ceph_pool_plugin.py +++ b/plugins/ceph_pool_plugin.py @@ -74,7 +74,7 @@ def get_stats(self): pool_key = "pool-%s" % pool['pool_name'] data[ceph_cluster][pool_key] = {} pool_data = data[ceph_cluster][pool_key] - for stat in ('read_bytes_sec', 'write_bytes_sec', 'op_per_sec'): + for stat in ('read_bytes_sec', 'write_bytes_sec', 'op_per_sec', 'write_op_per_sec', 'read_op_per_sec'): pool_data[stat] = pool['client_io_rate'][stat] if pool['client_io_rate'].has_key(stat) else 0 # push df results From a3880e75de8516790cb3a2d2265b4a754c46347b Mon Sep 17 00:00:00 2001 From: cfz Date: Tue, 28 Jun 2016 18:08:32 +0800 Subject: [PATCH 3/3] register read callback after conf callback --- plugins/ceph_latency_plugin.py | 2 +- plugins/ceph_monitor_plugin.py | 3 +-- plugins/ceph_osd_plugin.py | 2 +- plugins/ceph_pg_plugin.py | 2 +- plugins/ceph_pool_plugin.py | 2 +- 5 files changed, 5 insertions(+), 6 deletions(-) diff --git a/plugins/ceph_latency_plugin.py b/plugins/ceph_latency_plugin.py index 090dccd..d033eb8 100644 --- a/plugins/ceph_latency_plugin.py +++ b/plugins/ceph_latency_plugin.py @@ -79,11 +79,11 @@ def get_stats(self): def configure_callback(conf): """Received configuration information""" plugin.config_callback(conf) + collectd.register_read(read_callback, plugin.interval) def read_callback(): """Callback triggerred by collectd on read""" plugin.read_callback() collectd.register_config(configure_callback) -collectd.register_read(read_callback, plugin.interval) diff --git a/plugins/ceph_monitor_plugin.py b/plugins/ceph_monitor_plugin.py index 7521681..4c21694 100644 --- a/plugins/ceph_monitor_plugin.py +++ b/plugins/ceph_monitor_plugin.py @@ -76,11 +76,10 @@ def get_stats(self): def configure_callback(conf): """Received configuration information""" plugin.config_callback(conf) + collectd.register_read(read_callback, plugin.interval) def read_callback(): """Callback triggerred by collectd on read""" plugin.read_callback() collectd.register_config(configure_callback) -collectd.register_read(read_callback, plugin.interval) - diff --git a/plugins/ceph_osd_plugin.py b/plugins/ceph_osd_plugin.py index cab1be7..6e5651a 100644 --- a/plugins/ceph_osd_plugin.py +++ b/plugins/ceph_osd_plugin.py @@ -99,11 +99,11 @@ def get_stats(self): def configure_callback(conf): """Received configuration information""" plugin.config_callback(conf) + collectd.register_read(read_callback, plugin.interval) def read_callback(): """Callback triggerred by collectd on read""" plugin.read_callback() collectd.register_config(configure_callback) -collectd.register_read(read_callback, plugin.interval) diff --git a/plugins/ceph_pg_plugin.py b/plugins/ceph_pg_plugin.py index 43d2796..e48caf8 100644 --- a/plugins/ceph_pg_plugin.py +++ b/plugins/ceph_pg_plugin.py @@ -90,11 +90,11 @@ def get_stats(self): def configure_callback(conf): """Received configuration information""" plugin.config_callback(conf) + collectd.register_read(read_callback, plugin.interval) def read_callback(): """Callback triggerred by collectd on read""" plugin.read_callback() collectd.register_config(configure_callback) -collectd.register_read(read_callback, plugin.interval) diff --git a/plugins/ceph_pool_plugin.py b/plugins/ceph_pool_plugin.py index b1f2787..6ed9bcd 100755 --- a/plugins/ceph_pool_plugin.py +++ b/plugins/ceph_pool_plugin.py @@ -107,11 +107,11 @@ def get_stats(self): def configure_callback(conf): """Received configuration information""" plugin.config_callback(conf) + collectd.register_read(read_callback, plugin.interval) def read_callback(): """Callback triggerred by collectd on read""" plugin.read_callback() collectd.register_config(configure_callback) -collectd.register_read(read_callback, plugin.interval)