Skip to content

Commit

Permalink
Merge pull request #32 from mourgaya/master
Browse files Browse the repository at this point in the history
to take care with the --cluster option
  • Loading branch information
rochaporto committed Dec 24, 2015
2 parents eae93e6 + 8a2633d commit 74c567d
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion plugins/ceph_latency_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def get_stats(self):
output = None
try:
output = subprocess.check_output(
"timeout 30s rados -p data bench 10 write -t 1 -b 65536 2>/dev/null | grep -i latency | awk '{print 1000*$3}'", shell=True)
"timeout 30s rados --cluster "+ self.cluster +" -p data bench 10 write -t 1 -b 65536 2>/dev/null | grep -i latency | awk '{print 1000*$3}'", shell=True)
except Exception as exc:
collectd.error("ceph-latency: failed to run rados bench :: %s :: %s"
% (exc, traceback.format_exc()))
Expand Down
3 changes: 2 additions & 1 deletion plugins/ceph_monitor_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ def get_stats(self):
data = { ceph_cluster: { 'mon': { 'number': 0, 'quorum': 0 } } }
output = None
try:
output = subprocess.check_output('ceph mon dump --format json', shell=True)
cephmoncmdline='ceph mon dump --format json --cluster ' + self.cluster
output = subprocess.check_output(cephmoncmdline, shell=True)
except Exception as exc:
collectd.error("ceph-mon: failed to ceph mon dump :: %s :: %s"
% (exc, traceback.format_exc()))
Expand Down
3 changes: 2 additions & 1 deletion plugins/ceph_osd_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ def get_stats(self):
} }
output = None
try:
output = subprocess.check_output('ceph osd dump --format json', shell=True)
cephosdcmdline='ceph osd dump --format json --cluster ' + self.cluster
output = subprocess.check_output(cephosdcmdline, shell=True)
except Exception as exc:
collectd.error("ceph-osd: failed to ceph osd dump :: %s :: %s"
% (exc, traceback.format_exc()))
Expand Down
3 changes: 2 additions & 1 deletion plugins/ceph_pg_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ def get_stats(self):
data = { ceph_cluster: { 'pg': { } } }
output = None
try:
output = subprocess.check_output('ceph pg dump --format json', shell=True)
cephpg_cmdline='ceph pg dump --format json --cluster '+ self.cluster
output = subprocess.check_output(cephpg_cmdline, shell=True)
except Exception as exc:
collectd.error("ceph-pg: failed to ceph pg dump :: %s :: %s"
% (exc, traceback.format_exc()))
Expand Down
6 changes: 4 additions & 2 deletions plugins/ceph_pool_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,10 @@ def get_stats(self):

stats_output = None
try:
stats_output = subprocess.check_output('ceph osd pool stats -f json', shell=True)
df_output = subprocess.check_output('ceph df -f json', shell=True)
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)
except Exception as exc:
collectd.error("ceph-pool: failed to ceph pool stats :: %s :: %s"
% (exc, traceback.format_exc()))
Expand Down

0 comments on commit 74c567d

Please sign in to comment.