From 16aeaf8b112176dee716cae361060fcb7d985fe6 Mon Sep 17 00:00:00 2001 From: Juan Badia Payno Date: Mon, 21 Nov 2016 15:12:40 +0100 Subject: [PATCH] Added ceph user to ceph commands * oschecks-check_ceph_health example: oschecks-check_ceph_health client.monitoring_client * oschecks-check_ceph_df example: oschecks-check_ceph_df 80 90 client.monitoring_size Signed-off-by: Juan Badia Payno Change-Id: Icb986bac88b52a123c2f99941fadab8c9e233b22 --- monitoring-for-openstack/oschecks/ceph.py | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/monitoring-for-openstack/oschecks/ceph.py b/monitoring-for-openstack/oschecks/ceph.py index 581ad9b..8e2f4fc 100644 --- a/monitoring-for-openstack/oschecks/ceph.py +++ b/monitoring-for-openstack/oschecks/ceph.py @@ -81,7 +81,12 @@ def check_ceph_df(): 'Program entry point.' try: - res = subprocess.check_output(["ceph", "df", "--format=json"], + ceph_args = ["ceph", "df", "--format=json"] + if len(sys.argv) >= 4: + ceph_args.append('-n') + ceph_args.append(sys.argv[3]) + + res = subprocess.check_output(ceph_args, stderr=subprocess.STDOUT) exit_code, message = interpret_output_df(res) sys.stdout.write("%s\n" % message) @@ -119,7 +124,12 @@ def check_ceph_health(): 'Program entry point.' try: - res = subprocess.check_output(["ceph", "health"], + ceph_args = ["ceph", "health"] + if len(sys.argv) >= 2: + ceph_args.append('-n') + ceph_args.append(sys.argv[1]) + + res = subprocess.check_output(ceph_args, stderr=subprocess.STDOUT) exit_code, message = interpret_output_health(res) sys.stdout.write(message)