From 91c251fd94d73f44e8757b242db82ed240f80a1d Mon Sep 17 00:00:00 2001 From: "Tuxis Internet Engineering V.O.F" Date: Wed, 5 Oct 2016 11:06:48 +0200 Subject: [PATCH] fix: a dirty hack to prevent failing of stats when the cluster is rebuilding (#68) because Ceph returns '-inf' which the json decompiler doesn't seem to get.. --- agent-local/ceph | 6 +++--- debian/changelog | 7 +++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/agent-local/ceph b/agent-local/ceph index 60966aa..c9bd1a0 100755 --- a/agent-local/ceph +++ b/agent-local/ceph @@ -18,7 +18,7 @@ from subprocess import check_output import json def cephdf(): - cephdf = check_output(["/usr/bin/ceph", "-f", "json", "df"]) + cephdf = check_output(["/usr/bin/ceph", "-f", "json", "df"]).replace('-inf', '0') s = json.loads(cephdf) print("c:%i:%i:%i" % (s['stats']['total_bytes'], s['stats']['total_used_bytes'], s['stats']['total_avail_bytes'])) @@ -31,13 +31,13 @@ def cephdf(): def osdperf(): - osdperf = check_output(["/usr/bin/ceph", "-f", "json", "osd", "perf"]) + osdperf = check_output(["/usr/bin/ceph", "-f", "json", "osd", "perf"]).replace('-inf', '0') for o in json.loads(osdperf)['osd_perf_infos']: print("osd.%s:%i:%i" % (o['id'], o['perf_stats']['apply_latency_ms'], o['perf_stats']['commit_latency_ms'])) def poolstats(): - poolstats = check_output(["/usr/bin/ceph", "-f", "json", "osd", "pool", "stats"]) + poolstats = check_output(["/usr/bin/ceph", "-f", "json", "osd", "pool", "stats"]).replace('-inf', '0') for p in json.loads(poolstats): try: diff --git a/debian/changelog b/debian/changelog index a0676a9..39a11a1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,10 @@ +librenms-agent (1.0.6) stable; urgency=low + + - Fix a dirty hack to prevent failing of stats when the cluster is rebuilding + because Ceph returns '-inf' which the json decompiler doesn't seem to get.. + + -- Mark Schouten Tue, 05 Oct 2016 10:57:00 +0200 + librenms-agent (1.0.5) stable; urgency=low - Include a PowerDNS Authoritative agent